Install NodeJS on a Raspberry Pi
There are so many different ways todo this.
I like this one : https://learn.adafruit.com/node-embedded-development/installing-node-dot-js
curl -sLS https://apt.adafruit.com/add | sudo bash; sudo apt-get install node
Its easy, works and by a team I trust.
Swapping node versions
Node has lots of different versions and moves faster than most package managers (apt-get) can keep up, so using an extra tool to keep things fresh is handy.
I recommend using nvm
- Node Version Manager, its simple and does what it says on the tin.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
This lets you run nvm
and select what version of node you want to run.
I currently use node 4. nvm install v4
. Simple.