Install Node.js from Git repository and NPM on Ubuntu.
Make sure you have the necessary software
sudo apt-get update
sudo apt-get install git-core curl build-essential openssl libssl-dev g++
git clone https://github.com/joyent/node.git
git tag (list released versions and select the version you want)
git checkout v0.10.26
sudo make install
node -v (check that node is installed correctly and version matches your choice)
curl -O -L https://npmjs.org/install.sh | sudo sh
npm -v (check that NPM is installed correctly)
Grab a coffee, you’re done.