The official Node.JS install guide recommends manually downloading and building the Node.JS package for Debian. This can be done using the following set of commands:
sudo apt-get install python g++ make checkinstall mkdir ~/node_js_src && cd $_ wget -N http://nodejs.org/dist/node-latest.tar.gz tar xzvf node-latest.tar.gz && cd node-v* ./configure checkinstall sudo dpkg -i node_*
This install method should work fine but will take a long time to complete on the Raspberry Pi's hardware. For this reason I experimented a little and found a quicker install method that doesn't require a manual compile, by using the Ubuntu package.
This install method will be much faster than the official method but is not designed for Debian Wheezy, so use at your own risk! Personally I have not had any trouble with my node install yet but I cannot guarantee this will be the case for anyone else.
sudo apt-get update sudo apt-get install -y python-software-properties python g++ make sudo add-apt-repository ppa:chris-lea/node.js
At this point the file with the new repository details must be edited. Open the file:
/etc/apt/sources.list.d/chris-lea-node_js-wheezy.list with a text editor like
vim and change the word "wheezy" to "lucid". Thanks to Ken Yap for this hint.
Now, go on and finish installing Node.
sudo apt-get update sudo apt-get install -y nodejs