Tutorial: Install NODE.js on your raspberry pi

I use node for several raspberry pi projects. I even host this site with a server I built from node! Node.js allows you to run javascript on the server side. It's fast, scalable, and its free! Let me show you how to install it. If your pi is new and fresh out of the box, follow my Quick setup guide

What you will need

Step 1: Determine the version you need for your pi

Run the following command to see which version of arm your pi supports.

  • uname -m

Step 2: Download node.js

  • Go to the node.js download page
  • Find the version you need based on the output from the last command.
  • Right click on the version of ARM that you need and choose Copy Link address.
  • Now, go back to your pi terminal and type wget, space, then paste the link that you copied
  • Next change the last to characters to be gz, instead of xz.
  • For example, if you need armv7 it should look like this:
  • wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-armv7l.tar.gz
  • Step 3: Extract the archive and copy to /usr/local

    • tar -xzf node-v8.12.0-linux-armv7l.tar.gz
    • cd node-v8.12.0-linux-armv7l/
    • sudo cp -R * /usr/local/

    Step 4: Verify it works!

    • node -v
    • npm -v

    If you see version numbers for node and npm, you are all set!