1. Introduction

The Raspberry Pi is a great little computer for building projects with Node.js and npm — especially for working with GPIO or hardware. This guide shows how to install Node.js and npm easily on your Raspberry Pi.

2. Check your CPU architecture

First, check which CPU version your Pi is using:

bash

uname -m

Possible results:

  • armv6l: Raspberry Pi Zero W

  • armv7l: Raspberry Pi 2, 3

  • aarch64: Raspberry Pi 3 (64-bit), 4

3. Download the right Node.js version

Go to Node.js download page and choose the version that matches your CPU.

bash

wget https://nodejs.org/dist/v8.9.0/node-v8.9.0-linux-armv6l.tar.gz

⚠️ Make sure to change the version and architecture to match your Pi.

4. Extract the file

bash

tar -xzf node-v8.9.0-linux-armv6l.tar.gz

5. Install Node.js

Go into the extracted folder and copy the files into your system:

bash

cd node-v8.9.0-linux-armv6l
sudo cp -R * /usr/local/

6. Check if it works

Check your Node.js and npm versions:

bash

node -v
npm -v

That’s it! You’ve installed Node.js and npm on your Raspberry Pi. Now you can start building Node.js apps, control hardware, or run a small server.