Best-practices & guides for Node-RED
How to Install New Nodes/Plugins in Node-RED
In this advanced tutorial, you will learn how to install new nodes/plugins in Node-RED when the installation of new nodes fails (endless loop). This guide is especially useful when using S7 and OPC-UA nodes, and the installation of new nodes fails.
Node-RED is an open-source flow-based programming tool that provides an easy-to-use graphical interface for developing applications. Sometimes, when using S7 and OPC-UA nodes, the installation of new nodes/plugins may fail, which can be frustrating. In this guide, we will provide step-by-step instructions on how to install new nodes/plugins in Node-RED when the installation fails.
Please note that this process will remove all existing plugins, so be careful. Before trying this, please try the normal installation method instead
- Open UMHLens / OpenLens and go to "Workloads".
- Select the "Pods" tab and choose the "united-manufacturing-hub" namespace.
- Open the console of the Node-RED-Pod by clicking on the terminal icon.
- Enter the following commands in the console:
cd /data && rm -rf node_modules rm package-lock.json
This will remove all existing plugins in Node-RED.
- Install the packages that you need using the following command:
npm install --verbose [package-name]
[package-name]with the name of the package that you need to install.
For example, to install S7, OPC-UA, Cron-Plus, Edge-Trigger, Convert, and Float nodes, use the following command:
npm install --verbose node-red-contrib-s7 node-red-contrib-cron-plus node-red-contrib-opcua node-red-contrib-edge-trigger node-red-contrib-convert node-red-contrib-float
- Wait for the installation to complete.
- Reboot the container by typing "reboot" in the console or by killing the pod.