Installing npm and Node.js for Raspberry Pi
If you want to use Node-RED on Raspberry Pi, congratulations – you are already prepared to install Node-RED. This is because Node.js and npm are installed by default. You can use the existing installation script to install Node-RED, including Node.js and npm. This script will be described later in this chapter, in the Installing Node-RED for Raspberry Pi section, so you can skip this operation for now.
However, you should check your Node.js and npm versions on your Raspberry Pi. Please type in the following commands:
$ node --version v12.18.1 $ npm –version 6.14.5
If it is not the LTS version or stable version, you can update it via the CLI. Please type in and run the following commands to do this. In this command, on the last line, lts
has been used, but you can also put stable
instead of lts
if you want to install the stable version:
$ sudo apt-get update $ sudo apt-get install -y nodejs npm $ sudo npm install...