sudo aptitude install git-core curl build-essential openssl libssl-dev git clone https://github.com/joyent/node.git && cd node && git checkout v0.9.0 ./configure make sudo make install node -v
Up to this point, you are able to use the node command. You can then install npm which is a package manager of node.js its own:
curl http://npmjs.org/install.sh | sudo sh
sudo npm install uglify-js -g