Node.js 14 is a long-term support (LTS) release. This tutorial shows how to install Node.js 14 and npm on Raspberry Pi.
Connect to Raspberry Pi via SSH and add NodeSource repository that maintains Node.js 14 binary distributions.
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
Run command to install Node.js:
sudo apt install -y nodejs
Note that, we don’t need to install npm separately, it comes bundled with Node.js. After the installation is complete, check Node.js and npm versions:
node --version npm --version
We can remove any package with a name that starts with
nodejs and anything related to it by running the following command:
sudo apt purge -y nodejs.*