This is a very short introduction to setting up Node (Node.js) on a Raspberry Pi. The ambition of this document is to simplify the setup with ready made components and quickly build up an IoT Raspberry Pi Device (this guide however works stand-alone as well).
Luckily the installation is extremely easy. Here's how.
Note the installation steps described are only for ARM devices, such as Raspberry Pi. When you for instance emulate the process on a different device (say Ubuntu VM), the below will not work. Try a standard installation approach instead, for Intel bases devices. There are many guides, for example here
- Make sure an internet connection is available. We will download stuff shortly
- Download the ARM version of Node
- Install the ARM Node package
sudo dpkg -i node_latest_armhf.deb
- Install npm
sudo apt install npm
- Make sure the installation is valid
node –v npm -v
- Remove the installation package
That's it. Done