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++

Install Node.js

git clone
cd node
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)

Install NPM

curl -O -L | sudo sh
npm -v (check that NPM is installed correctly)

Grab a coffee, you’re done.