15:03
How to upgrade Node.js in Ubuntu to the latest version:
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
# install : node-v4.0.0
# mkdir : /usr/local/n/versions/node/4.0.0
# fetch : https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-x64.tar.gz
# installed : v4.0.0
$ sudo n 4.0.0
$ node -v
# v4.0.0
It's done! Enjoy the 4.0 ;-)
cf. http://davidwalsh.name/upgrade-nodejs
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
# install : node-v4.0.0
# mkdir : /usr/local/n/versions/node/4.0.0
# fetch : https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-x64.tar.gz
# installed : v4.0.0
$ sudo n 4.0.0
$ node -v
# v4.0.0
It's done! Enjoy the 4.0 ;-)
cf. http://davidwalsh.name/upgrade-nodejs