Administrative

Upgrade Node.js to the latest version via NPM

  • Last tested on Ubuntu 16.04 LTS (xenial) | easy | less than five minutes
# check the current version number
$ node -v

# clean cache forcefully
$ sudo npm cache clean -f

# install n Module
$ sudo npm install -g n

# install Nodejs
$ sudo n stable

# setup binary link -- use the version number for the folder path
$ sudo ln -sf /usr/local/n/versions/node/6.0.0/bin/node /usr/bin/node

# check updated Nodejs version
$ node -v