Installing a new version of node.js on a DigitalOcean droplet Ubuntu 14.04 server

Thursday, April 09, 2015

I need to install the latest version of node.js on my droplet (v.0.12.2 at time of writing).
I will use NVM (Node Version Manager) tool on my server.

First of all, get the needed packages on Ubuntu:

sudo apt-get update
sudo apt-get install build-essential libssl-dev

Then, get and install NVM (current version is 0.24.1):


curl https://raw.githubusercontent.com/creationix/nvm/v0.24.1/install.sh | bash


Install node.js v.0.12.2:


nvm install 0.12.2


NVM should activate this version by default, check with node -v if it is correct. If not, run the command: nvm use 0.12.2


NOTE #1: to check all the available node.js versions on NVM repositories, launch: nvm ls-remote

NOTE #2: if you're using globally installed node modules, like forever or express-generator, you need to reinstall them with npm, in order to link them to the new node.js version. Anyway, read the output of the NPM installing process.

You Might Also Like

0 commenti

Subscribe