Installing NPM and NodeJS in Ubuntu

Possible Solution (Not Tested):
http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/

Updating NPM
Refer: http://stackoverflow.com/questions/23393707/how-to-update-npm

This will update npm using npm itself:

# This is for initial installation
$ sudo npm install npm -g

# This is for upgrade
$ sudo npm update npm -g

From article: If you are stuck, try sudo npm update npm -g. All credit goes to Tim Castelijns. I have tested it on ubuntu 14.04, npm 1.3.10

Note that if you are using nvm for managing multiple versions in your local dev environment for e.g. testing purposes, all your installed versions (listed by nvm ls) are in ~/.nvm, hence you just omit system wide installation (i.e. omit sudo):

$ npm install npm -g

Updated version of NodeJS - Chris Lea
Refer: https://nodesource.com/blog/chris-lea-joins-forces-with-nodesource

Leave a Reply