Upgrading Node.js to latest version ? How to Update Node to Any Version Using Npm ?

Tran Ngoc Tung
1 min readJul 4, 2019

--

How to Upgrading Node.js to latest version ?

On Linux/Mac:

The module n makes version-management easy:

sudo npm install n -g

For the latest stable version:

sudo n stable

For the latest version:

sudo n latest

Another way :

nvm install v10.15 //v10.15 is a version i want.

Check current version

node -v

How to Update Node to Any Version Using Npm ?

Step 1: Clean npm cache

sudo npm cache clean -f

Step 2: Install node helper (n) globally using the following command.

sudo npm install -g n

Once node helper is installed. You can either get the latest stable version using

sudo n stable

Or if you want specific version like I needed 8.0.0 then you can do this using.

sudo n 9.6.0

After upgrade you can check the latest version of node using

node — version

or

node -v.

--

--