How to install Node.js on Raspberry Pi
Installing Node.js on Raspberry Pi is very simple for those with basic command line experience.
In the terminal or via SSH:
- Add the package source:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- Install Node using:
sudo apt-get install -y nodejs
- Confirm package is installed:
node -v
Extra steps
You may also wish to install the development tools to build native addons:
sudo apt-get install gcc g++ make
And you may wish to install Yarn package manager to replace NPM:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn