How to install the latest NodeJS on Raspberry PI 0 W?

TL;DR; Officially you can’t install above v10.21.0 v11.15.0, but unofficially you can get the latest one, currently 14.15.1.

The fastest way to get the latest officially supported version is:

wget -O - | bash

The script is provided by this repo

With that script in mind and the knowledge that NodeJS foundation offers “unofficial builds” plus this comment you might be able to install the latest version (currently 14.15.1) using this script:

export NODE_VER=14.15.1
if ! node --version | grep -q ${NODE_VER}; then
  (cat /proc/cpuinfo | grep -q "Pi Zero") && if [ ! -d node-v${NODE_VER}-linux-armv6l ]; then
    echo "Installing nodejs ${NODE_VER} for armv6 from unofficial builds..."
    curl -O${NODE_VER}/node-v${NODE_VER}-linux-armv6l.tar.xz
    tar -xf node-v${NODE_VER}-linux-armv6l.tar.xz
  echo "Adding node to the PATH"
node --version # or whatever ....

Copy the script above to a shell script file like and do chmod +x and then run it ./

Or wget

Then add the following line to your .bashrc file:


(Note the version and location!)

Alternatively you can get v10.21.0 by simply running:

sudo apt-get install -y nodejs


Some tutorials will tell you to do:

curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

But that’s a waste of time because you will get the following message:

## Installing the NodeSource Node.js 14.x repo…

## 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 for Node.js 4 and later.

This is because the Raspberry PI 0 (and Raspberry PI 1) architectures are ARMv6 and not the more common ARMv7/ARMv8.

If you take a look at NodeJS 10.x, 12.x, 14.x, architectures list you will notice the last one that was compiled to ARMv6 was version v11.15.0 or check here.

That’s why when you run apt install you get 10.x

With that said, if you are thinking of using n or nvm to switch your NodeJS version and get a higher one know that I tried that myself and it was compiling for about 2 hours on the Raspberry PI 0 before I decided to force it to stop.

P.S. This is an unofficial way to install the latest version of NodeJS (meaning they no longer have unit tests validated) and I cannot grantee everything will work flawless but for my use case everything is working. (Twitch API connection and motor hat control)

Let me know on Twitter if you have any questions/comments.

A personal blog by Rodrigo Graça about coding, p2p, health, and much more (Psst... I am open to opportunities.)

Reach out to me on your favorite social :)