Tag Archives: nodejs

Install or Upgrade to latest Node JS version in Ubuntu

Node Js

Node JS

We can install Node JS or upgrade currently installed version to latest version via two methods

  1. Installing latest .tar file and
  2. Node Version Manager (NVM)

Installing Node JS via .tar file

Download the latest version from https://nodejs.org/en/

At the time of writing this tutorial current version of node js is 8.11.3 LTS.

Now add it to environment variable bu running below command

Check the version of node js

Installing / upgrading Node Js via NVM

Other way to install / upgrade Node Js is via NVM (Node Version Manager) 

If it is not already installed on your machine, then follow below steps to install it, skip it already installed. You can also check these steps in the official documentation of NVM here

Run the script

Now source the profile to get the access in the current session which doesn’t require you logout and login back.

To see the list of versions available for installation run below command

To install a version that you need

Tell nvm to use currently installed version

Confirm the currently installed version by

 

Install or update nodejs usin NVM in Ubuntu

Node JS is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event driven, non-blocking I/O model that makes it lightweight and efficient
 Using nvmNVM, which stands for “Node.js version manager” we can install multiple versions of nodejs on Ubuntu.

To install or update nvm, you can use the install script using cURL: ( You can find the installation instructions on projects github page https://github.com/creationix/nvm/blob/master/README.md)


or using Wget:


Run the script by running 


To get the list of available Node.js versions

Installing node js on Ubuntu using NVM

Node JS can be installed using various methods, but in this post I am going to show you how to install it using NVM (Node Version Manager)

To install NVM through curl

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.1/install.sh | bash

or Wget:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.25.1/install.sh | bash

The script clones the nvm repository to ~/.nvm and adds the source line to your profile (~/.bash_profile, ~/.zshrc or ~/.profile).

After this restart PC / VPS to make command NVM available. You will get list of options when you type NVM in your terminal.

Now you can run

nvm install version_name

at the time of writing, latest version of nodejs is 0.12.3. So this can be

nvm install 0.12.3

dev@devenubuntu:~$ nvm install 0.12.3
######################################################################## 100.0%
Now using node v0.12.3 (npm v2.9.1)

You can verify the installation by running

dev@devenubuntu:~$ node -v
v0.12.3