Best way to install Node and keep it up to date

The easiest way to install Node is head over to
NodeJS’s website
and download the LTS version.
The LTS Version is good enough for most users. I use LTS myself.


This content originally appeared on Zell Liew and was authored by Zell Liew

(Hey, we're having problems showing images in RSS right now, so if you want a better reading experience, consider viewing this article online [here](https://zellwk.com//blog/install-node. We hope to fix this soon!).

The easiest way to install Node is head over to NodeJS's website and download the LTS version.

The LTS Version is good enough for most users. I use LTS myself.

The Current version is the latest available version. Developers will be making changes and creating libraries on this version. If you use Current, be prepared to run into bugs.

Once you downloaded and installed Node, you should be able to use the node command and the npm command. You can add -v to each of these commands to see their respective versions.

node -v
npm -v

Upgrading and Downgrading Node with a Package Manager

You want to have the flexbility to upgrade and downgrade Node easily if you're going to work with Node.

The simplest way is to use npm (node default package manager), to install a package n. n lets install a specific version of Node easily.

You can install n with the following command.

sudo npm install n -g

The -g flag here stands for global. It lets you use the n command everywhere.

Once you have installed n, you can use the following commands to install different versions of Node.

  • sudo n lts — installs the LTS version
  • sudo n latest — installs the latest version
  • sudo n install <num> — Installs a specific version on Node. Here, you only need to provide the first number. (To get the latest version of 16.xx.yy, you can simply write 16).

Using other package managers

You're not limited to using n to upgrade or downgrade Node. There are other package managers available and you can choose the one you like.


This content originally appeared on Zell Liew and was authored by Zell Liew


Print Share Comment Cite Upload Translate Updates
APA

Zell Liew | Sciencx (2022-05-24T16:00:00+00:00) Best way to install Node and keep it up to date. Retrieved from https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/

MLA
" » Best way to install Node and keep it up to date." Zell Liew | Sciencx - Tuesday May 24, 2022, https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/
HARVARD
Zell Liew | Sciencx Tuesday May 24, 2022 » Best way to install Node and keep it up to date., viewed ,<https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/>
VANCOUVER
Zell Liew | Sciencx - » Best way to install Node and keep it up to date. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/
CHICAGO
" » Best way to install Node and keep it up to date." Zell Liew | Sciencx - Accessed . https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/
IEEE
" » Best way to install Node and keep it up to date." Zell Liew | Sciencx [Online]. Available: https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/. [Accessed: ]
rf:citation
» Best way to install Node and keep it up to date | Zell Liew | Sciencx | https://www.scien.cx/2022/05/24/best-way-to-install-node-and-keep-it-up-to-date/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.