Installing node.js on debian wheezy

There are a few ways of installing nodejs on debian. You can build from source or you can use the backports repository.

I personally use the repository as then the system package manager can handle updating etc. I normally find packages on servers that are built from source often get left and never get updated. Also if you are using a vps or limited machine you don’t have to strain the system with compiling.

install nodejs

add-apt-repository 'deb http://ftp.us.debian.org/debian wheezy-backports main'
apt-get update
apt-get install nodejs-legacy

install npm

cd /tmp
wget https://www.npmjs.org/install.sh --no-check-certificate
chmod +x install.sh
./install.sh