Testing your own node in a local environment
You have already completed your own node. Let's add the nodes created so far to Node-RED in a local environment.
For your own nodes, it is very important to check their operation locally. Publishing a node on the internet without making sure it works in your environment is not good for many developers.
So, in this section, you'll be testing your own node in your local environment.
Node installation
You can use the npm link
command to test the node module locally. This allows you to develop nodes in your local directory and link them to your local Node-RED installation during development.
This is very simple. Follow these steps:
- Execute the following command on the CLI to add a node and start Node-RED:
$ cd <path to node module> $ npm link
This will create the appropriate symbolic link to the directory and Node-RED will discover the node at boot time. Simply restart Node-RED to get the changes to the node...