Skip to content

Instantly share code, notes, and snippets.

@davps
Last active May 8, 2025 00:51
Show Gist options
  • Save davps/6c6e0ba59d023a9e3963cea4ad0fb516 to your computer and use it in GitHub Desktop.
Save davps/6c6e0ba59d023a9e3963cea4ad0fb516 to your computer and use it in GitHub Desktop.
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

cd node-v6.2.1-linux-armv6l/
sudo cp -R * /usr/local/

For testing add /usr/local/bin to your path

export PATH=$PATH:/usr/local/bin
node -v
npm -v

This should print 6.2.1 and 3.9.3 for the versions of nodejs and npm. If you need a different version, just pick the one you like from the downloads.

Don't forget to add the PATH to your .bashrc to make it permanent.

To find the correct architecture, you can type uname -m

#Source http://raspberrypi.stackexchange.com/a/48313

@ArmandoShala
Copy link

@pituluk
Can you be more specific? What do you mean be doesnt seem to work properly? Like when running or when updating?

@eliot-akira
Copy link

eliot-akira commented May 7, 2025

Thanks for this helpful note. Confirmed working for Node.js v21.7.3 on Pi Zero W (armv6l).

This seems to be the last version that can run on 32-bit ARM. See nodejs/unofficial-builds.

curl -L https://unofficial-builds.nodejs.org/download/release/v21.7.3/node-v21.7.3-linux-armv6l.tar.xz | tar xJ
cd node-*
rm CHANGELOG.md LICENSE README.md
cp -R * ~/.local

In my case I installed it for the current user (~/.local) instead of all users (/usr/local). This way both node and npm commands work without sudo. Add ~/.local/bin to the PATH, such as in .bashrc.

export PATH="~/.local/bin:$PATH"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment