Node.js installation with nvm on Raspberry pi

Hadi Azami edited this page Aug 18, 2018 · 4 revisions


  • A Raspberry pi with Raspbian installed.
  • An internet access.

Update Raspbian

$ sudo apt update -y && sudo apt upgrade -y

Wait a very long time...

Install nvm

(Node Version Manager,

Execute following commands:

$ git clone ~/.nvm
$ sudo echo "source ~/.nvm/" >> ~/.bashrc && sudo echo "source ~/.nvm/" >> ~/.profile

Exit all terminals and/or ssh sessions and open a new one.

Check if installation work

$ nvm --version
Should return the version of nvm installed. (for me 0.25.4)

Install Node.js

You can see all available version of node js at this url When you click on, you can see that it was compiled for the raspberry pi (you can see the file: node-v0.10.26-linux-arm-pi.tar.gz).

Install node.js and upgrade npm by running these commands:

$ nvm install 8.11.4 

# Or this (for latest LTS version)
$ nvm install --lts

# Switch to installed node version
$ nvm use 8.11.4 

# Or switch to LTS
$ nvm use --lts

# then update npm
$ npm -g install npm@latest --allow-root --unsafe-perm 
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.