Enable the NodeSource repository by running the following command in your terminal:
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
Once the repository is enabled, install Node.js and npm by running the following command:
sudo apt install nodejs
To verify the installation, run the following command:
node --version
This documentation uses MQTT.js as a client library.
Install the library by running the following command:
npm install mqtt --save
Start connecting devices by following the guide :