nodejs · raspberry pi

Installing NodeJS on a Raspberry PI

screen-shot-2017-03-04-at-6-15-17-am

There are two ways…

The easiest is to install using the package manager.  Recently though I ran into an issue where the folks providing the package manager version forgot to include the ARMv6 build. If that’s the case while you attempt, move onto the tarball method and you’ll be up and running in no time.

With package manager…

First, install NodeJS.  At the time of this writing, I prefer NodeJS 6.  The best way to install it is through the package manager.  This site contains all the details:

https://nodejs.org/en/download/package-manager/

The important bit is this (Note: this can take a little while):

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

When package manager fails!  The tarball method…

Sometimes the folks supporting the builds have a glitch, and the ArmV6 version of the build doesn’t get published…. so it will complain with this message:

“## You appear to be running on ARMv6 hardware. Unfortunately this is not currently supported by the NodeSource Linux distributions. Please use the ‘linux-armv6l’ binary tarballs available directly from nodejs.org for Node.js v4 and later.”

Which is bunk, but here is the work around during these dark times:

wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-armv6l.tar.xz
tar xvf node-v6.10.0-linux-armv6l.tar.xz
cd node-v6.10.0-linux-armv6l
sudo cp -R bin/* /usr/bin/
sudo cp -R lib/* /usr/lib/
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential

3 thoughts on “Installing NodeJS on a Raspberry PI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s