How to install specific version / latest node.js 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 
READ  How to Add new user and Delete existing user on Ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *