How to install NodeJS and NPM on the RaspberryPi without getting “Illegal Instruction” error messages

I tried a couple of times to compile NodeJS on the RaspberryPi and failed miserably. It not only takes ages to compile NodeJS on the Pi. After the successful compile and install run most of the time running it just results in an error message “Illegal Instruction” or “Ungültiger Maschinencode”.

Now there’s a pretty easy way to do that on your own. Run these commands:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb

After the download is finished successfully you can install it by running this as root:

sudo dpkg -i node_latest_armhf.deb

This will have installed a relatively new NodeJS built as well as NPM on your RaspberryPi. Don’t panic when NPM is slower than you would expect… just be patient.

Enjoy!