Installing Node v10+ on a Raspberry Pi Zero
Sep 18, 2022
Sep 18, 2022
Putting NodeJS on a Raspberry Pi isn't too difficult once you know what to look for. NodeJS hasn't been officially supported since v10 but there are Unofficial Builds: https://unofficial-builds.nodejs.org/download/release/
This has builds for more recent versions for the armv6l processor that the Pi Zero and its variants have. For this I'll use v18.9.0
:
cd ~
wget https://unofficial-builds.nodejs.org/download/release/v14.10.0/node-v18.9.0-linux-armv6l.tar.gz
tar -xzf node-v18.9.0-linux-armv6l.tar.gz
node-v18.9.0-linux-armv6l/bin/node -v
The last command should display v18.9.0
If so, we can copy it over to /usr/local
:
cd node-v18.9.0-linux-armv6l/
sudo cp -R * /usr/local/
We can then check to make sure it was successful:
cd ~
node -v
This should display v18.9.0
if everything went well.
Hope this helps anyone else looking to run NodeJS on a Raspberry Pi Zero or its variants.