Skip to content

Install Nodejs and NPM

_Node.js_is an open source server environment;_Node.js_is free;_Node.js_runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.). There are two ways you can use to install #nodejs and NPM on your #Raspberry.

Install nodejs from NodeSource repository

Launch the Terminal and execute the command below:

Terminal window
sudo su
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
sudo apt install nodejs

Install nodejs from source code

Terminal window
sudo apt update
sudo apt upgrade

Then you have to detect platform with uname -m and download correct file from dist wigh wget:

Terminal window
sudo wget https://nodejs.org/dist/latest/node-v18.3.0-linux-armv7l.tar.gz

Untar file and copy content to /usr/local folder:

Terminal window
sudo tar -xzf node-v18.3.0-linux-armv7l.tar.gz
cd node-v18.3.0-linux-armv7l
sudo copy -R * /usr/local