Node-RED: Difference between revisions

From Axel Public Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 26: Line 26:
=== Check the npm version ===
=== Check the npm version ===


The package manager npm is usually distributed along with Node.js. If not, you can manually install it using the following command:
The package manager npm is usually distributed along with Node.js. You can check both the versions of Node.js and npm you got with:
sudo apt-get install npm
However, npm is updated much more frequently than Node.js, and for this reason you may have to manually update npm.
Before doing this, please check which versions of both Node.js and npm you have installed into your system by using the following commands:
  node -v
  node -v
  npm -v
  npm -v
If npm didn't get added with Node.js, you can manually install it with the following command:
sudo apt-get install npm
After that, follow [https://nodered.org/docs/getting-started/installation this link] to make sure that the versions you got are still supported by Node-RED. If not, you can manually update npm to
After that, follow [https://nodered.org/docs/getting-started/installation this link] to make sure that the versions you got are still supported by Node-RED. If not, you can manually update npm to
its latest version with the following command:
its latest version with:
  npm install npm@latest -g
  npm install npm@latest -g


On the other side, if your version of Node.js is too old, you have to install a newer release.
On the other side, if you have an old version of Node.js, you have to install a newer release.


''Note: The package has been developed and tested with v8.11.1 of Node.js and v5.6.0 of npm.''
''Note: The package has been developed and tested with v8.11.1 of Node.js and v5.6.0 of npm.''

Revision as of 15:09, 18 June 2018

This wiki document explains how to install the package that contains the following modules:

  • GetTagValue
  • SetTagValue

These nodes interact with LogicLab and their aim is to, respectively, read/write a value for a requested symbol target.


Requirements

In order to make this package work, you have to install the JavaScript runtime Node.js, the package manager npm and Node-RED. The package manager is usually provided along with the Node.js installer, however you should make sure that both the versions you got are still supported by Node-RED.

Install Node.js

Windows: Follow the link below:

download Node.js

Linux: Open up a terminal and execute the following commands:

 sudo apt-get update
 sudo apt-get install nodejs

Check the npm version

The package manager npm is usually distributed along with Node.js. You can check both the versions of Node.js and npm you got with:

node -v
npm -v

If npm didn't get added with Node.js, you can manually install it with the following command:

sudo apt-get install npm

After that, follow this link to make sure that the versions you got are still supported by Node-RED. If not, you can manually update npm to its latest version with:

npm install npm@latest -g

On the other side, if you have an old version of Node.js, you have to install a newer release.

Note: The package has been developed and tested with v8.11.1 of Node.js and v5.6.0 of npm.

Install Node-RED

With your terminal, Further information can be retrieved from the following links:


Install the package

Open up a terminal and change the directory path to the folder where Node-RED has been installed. After that you can add the package by using the npm command shown below. Be careful to specify the path that points to the main folder of the package to be installed (it contains a file named package.JSON).

cd /home/USER_NAME/.node-red
sudo npm install PATH_TO_FOLDER_WITH_FILE


Running

Now you can finally use the modules (nodes) of the package by starting Node-RED with the following command:

node-red start