To install Node.js, first install the below prerequisite and add the node.js repository.
# sudo apt-get install python-software-properties
# sudo apt-add-repository ppa:chris-lea/node.js
Now install Node.js and npm (the Node Packet Manager).
# sudo apt-get update
# sudo apt-get install nodejs npm
Thats it. Your Node.js is ready. Test by running the below command.
# node -v
v0.6.18
Node.js stable releasesare done quite frequently. To upgrade run,
# sudo apt-get update# sudo apt-get upgrade nodejs npm
You could also use the Ubuntu Update Manager to do the update.
If you are the kind who prefers to directly build from the sources then,
# cd <directory># sudo wget http://nodejs.org/dist/v0.6.18/node-v0.6.18.tar.gz
# sudo tar -zxf node-v0.6.18.tar.gz# cd node-v0.6.18 # sudo ./configure# sudo make# sudo make install# node -vv0.6.18
The latest version was v0.6.18 at the time of writing this post.
For other platforms, installation is simple. See the Node.js installation web page.