Pre-Flight Check
- These instructions are intended specifically for installing Node.js via NVM (Node Version Manager) on a single Ubuntu 12.04 LTS node.
- I’ll be working from a Liquid Web Core Managed Ubuntu 12.04 LTS server, and I’ll be logged in as root.
- If NVM is not already installed, then visit our tutorial on: How to Install NVM (Node Version Manager) for Node.js on Ubuntu 12.04 LTS
Step #1: Install NVM (Node Version Manager)
If NVM is not already installed, then visit our tutorial on: How to Install NVM (Node Version Manager) for Node.js on Ubuntu 12.04 LTS
Step #2: Check Available Node.js Versions
Versions that are available for installation:
nvm ls-remote
In addition to the versions listed by the output of that command, it is also possible to install the latest stable or unstable versions, as shown in the next step.
Step #3: Install a Node.js Version
To download, compile, and install the latest version in the v0.11.x release of node.js:
nvm install 0.11
To display currently activated version:
nvm current
Which gives me the output:
v0.11.16
In this case, I am now running v0.11.16.
To download, compile, and install the latest stable release of node.js, which in this case is v0.12.2:
nvm install stable
To display currently activated version:
nvm current
Now gives me the output:
v0.12.2
I am now running v0.12.2.
nvm ls
Gives the following output:
v0.11.16
-> v0.12.2
node -> stable (-> v0.12.2) (default)
stable -> 0.12 (-> v0.12.2) (default)
unstable -> 0.11 (-> v0.11.16) (default)
And finally, if you want to modify PATH to use v0.11.16 again, then use the following command:
nvm use 0.11.16
Which returns:
Now using node v0.11.16