One of the things I’ve noticed while trying to set up Node.js on my Raspberry Pi is that every tutorial has a different way of reaching the same goal. The worst part of that is, most of the walk throughs end up having you install out of date versions NodeJS and NPM.

This presents a major issue when trying to run some of the tools offered by www.NodeSchool.io, which are a great way to learn Node by completing tutorial projects. They have a few lessons like, javascripting, learnyounode, and git. I was ecstatic to find these lessons because they are a great free way of getting some hands on experience with javascripting and using NodeJs. Getting it all to work on a Raspberry Pi though, is a whole ‘nother task all together.

Here’s what I found in my troubleshooting.

To install NodeJs you have to make sure you have the latest updates on Raspbian (or whichever distribution you are using).

sudo apt-get update
sudo apt-get upgrade

Then we’ll install NodeJs.
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
Unpack using:
sudo dpkg -i node_latest_armhf.deb

Then run the version check command to make sure the latest version of Node has been installed.

node --v
and
npm --v

Great, now this is where things start to get a little hairy canary. The reason is our javascripting, learnyounode and git training programs require super user permissions in order to install properly. There is a correct way to do this, but I have not run through it on my system so I cannot confirm it works in the end. At worst giving these programs super user status can have dangerous consequences, but in reality we are using Raspberry Pi’s so the worst case is reloading our o.s. We are looking to experiment and learn, so if some scratchy code makes a few unauthorized changes I’ll live. These tutorials are completely worth it in my book.

To get them to run, nothing else worked for me other than these commands.

sudo npm install --global learnyounode

Yes, that’s it. To install the other programs just rinse and repeat.

sudo npm install --global javascripting
and
sudo npm install --global git-it

To run these handy programs simply type in learnyounode or javascripting or git-it, respectively. Now instead of troubleshooting the tutorials the only thing you’ll have to worry about it is actually learning the language!

// Thank you @martinheidegger for adding this post to the nodeschool wiki, check it out at https://github.com/nodeschool/discussions/wiki/Installation-suggestions

 

Here are two references that helped me find my solutions, and also provide some interesting additional material.

http://nitya.gitbooks.io/meteor-workshop/content/nodejs_primer/core_git-it.html
https://learn.adafruit.com/node-embedded-development/installing-node-dot-js