Tuesday, November 28, 2017

How to install the latest version nodejs

Step 1 – Add Node.js PPA

Node.js is available in two versions, first is current (most recent version) and another is LTS. Select which version you need to install on the system. Then use one of following commands to install PPA on your system. Node.js officially provides these PPA’s.
Use Current Release: At te last update of this tutorial, Node.js 8.0 is the current Node.js release available.
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
Use LTS Release : At te last update of this tutorial, Node.js 6.11 is the LTS release available.
$ sudo apt-get install python-software-properties
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
For this tutorials, we are using latest current release and added their PPA to my system.

Step 2 – Install Latest Node.js and NPM

After adding required PPA file lets install Node package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.
$ sudo apt-get install nodejs

Step 3 – Check Node.js and NPM Version

After installing node.js verify and check the installed version. You can find more details about current version on node.js official website.
$ node -v 

v8.7.0
Also, check the version of installed npm.
$ npm -v 

5.4.2

No comments:

Post a Comment