Avoid installing Node.js on Ubuntu from the repositories. They are out-dated. The best option is to download the sources and build.
Node.js sources can be downloaded from http://nodejs.org/#download
Alternatively, if you’re a GitHub user, you can clone the repository with:
git clone git://github.com/joyent/node.git
Next step, navigate to the Node.js source root folder and execute the following:
sudo make install
NPM is a package manager for Node similar to Apache Maven, Gradle, SBT etc.
npm is a package manager for node. You can use it to install and publish your node programs. It manages dependencies and does other cool stuff.
Install it with this one line command:
curl http://npmjs.org/install.sh | sh
Copy from srirangan.net