Skip to content

Instantly share code, notes, and snippets.

@davps
Last active March 20, 2024 23:42
Show Gist options
  • Star 53 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • 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

@Natsurii
Copy link

Natsurii commented Sep 4, 2020

Verified and still working v14.9.0 (armv6l binary) on Zero W

@MarkusBansky
Copy link

I have used wget https://unofficial-builds.nodejs.org/download/release/v14.10.0/node-v14.10.0-linux-armv6l.tar.gz for the latest node-js version to install it on my Raspberry Pi Zero W and it worked like a charm!

@astarrett
Copy link

I now have node-v12.15.0-linux-armv6l downloaded to my Raspberry Pi Zero W as per these instructions. Now I get the error: 'You need to run "nvm install v12.15.0" to install before using it.'
I am completely new at this and learning as I go. When I try to run nvm install it looks at the nodejs source and not the local source. Any guidance would be greatly appreciated.

@dkossman
Copy link

dkossman commented Sep 27, 2020

FYI I was able to get 14.10.0 running on a Pi Zero W running Raspbian Buster. Sounds like the newer versions of nodejs won't run on older versions of Raspbian.

@sa1d
Copy link

sa1d commented Nov 22, 2020

Per @dkossman 's comment, you can use that repository with nvm to easily manage installed nodejs versions.
First you need to set repo variable with export NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release
Then, you can run nvm ls-remote to see available versions and nvm install v15.2.1 to install nodejs version 15.2.1.

@jishan484
Copy link

Real challenge is to install sqlite3.js in r pi zero w..can anyone help me with this...

@soupCodez
Copy link

Working on RasPi zero W (16.2.0)

@tom-curley
Copy link

16.4.2 working on Raspberry PI 4

@NoobTracker
Copy link

Is it possible to get the version 14+ running on arm6?

@PaulMerk
Copy link

PaulMerk commented Oct 6, 2021

working on Raspi B3:
https://nodejs.org/dist/v16.10.0/node-v16.10.0-linux-armv7l.tar.xz

@vandernorth
Copy link

For Pi Zero W with arm6l this v16.17.0 worked for me.
wget https://unofficial-builds.nodejs.org/download/release/v16.17.0/node-v16.17.0-linux-armv6l.tar.gz

@michapixel
Copy link

even 19.1.0 worked.

@philipostli
Copy link

philipostli commented May 5, 2023

Per @dkossman 's comment, you can use that repository with nvm to easily manage installed nodejs versions. First you need to set repo variable with export NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release Then, you can run nvm ls-remote to see available versions and nvm install v15.2.1 to install nodejs version 15.2.1.

Thank you @sa1d ! This definately solved a big issue. Those old raspberries are no longer supported by Node. Using this method helped nvm quickly install the right version on my Pi B+. Now running latest version of Node.js.

@atlc
Copy link

atlc commented Sep 25, 2023

Confirmed working for 20.7.0 on Pi Zero W

wget https://unofficial-builds.nodejs.org/download/release/v20.7.0/node-v20.7.0-linux-armv6l.tar.gz
tar -xzf node-v20.7.0-linux-armv6l.tar.gz
cd node-v20.7.0-linux-armv6l
sudo cp -R * /usr/local

@harphere
Copy link

Confirmed working for 20.7.0 on Pi Zero W

wget https://unofficial-builds.nodejs.org/download/release/v20.7.0/node-v20.7.0-linux-armv6l.tar.gz
tar -xzf node-v20.7.0-linux-armv6l.tar.gz
cd node-v20.7.0-linux-armv6l
sudo cp -R * /usr/local

Worked great on my Pi Zero W, thank you.

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