How to install specific / latest node.js version on Ubuntu

If you want to install node.js which is gaining popularity in recent days, you can follow below steps,

npm is the package manager for node.js JavaScript which we need to install in first,

 $ sudo apt-get install npm 
 $ sudo npm install n -g 
 $ sudo n latest 

Now, you can check which all node versions are supported and which is the latest installed version as,

 $ node -v 

and check all node verions as,

 $ n ls 

Now, lets say if you have seen latest node version is 9.4.0 and want to install “6.8.1” version, use below command,

 $ sudo n 6.8.1 

Now, you can see version 6.8.1 is installed,

 $ node -v 
Follow Lynxbee

One Response

  1. Matt Kiss November 10, 2018

Leave a Reply / Ask Question