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 
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded
Tags:

Leave a Reply