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