This is a simple shell script that will install the latest NodeJs v9.x or the version of your choice. The "Latest version" of NodeJs version of 9.x in the raspberry pi on every version of raspberry pis (zero|1|2|3) This also happens to work on a Beaglebone and other ARM6 or ARM7 linux computers.
You can install everything on your pi by going into you Raspberry Pi zero|1|2|3's terminal, and running:
sudo su;
wget -O - https://raw.githubusercontent.com/audstanley/NodeJs-Raspberry-Pi/master/Install-Node.sh | bash;
exit;
node -v;
Use this script either with no parameter, or with the version you wish to install, eg:
sudo ./Install-Node.sh
or for instance
sudo ./Install-Node.sh 8.9.1
Please note that this should work for EVERY raspberry pi.
As new integer versions of NodeJs come out, I will update the script. I even wrote some NodeJs code that checks for integer updates every hour, and will send me a push notification to my phone, so this script should be up to date for a LONG time. Here is that code: checkNodeJsForLatestDistro
or stop by at my blog: audstanley.com