Hello,
I am currently trying to create a Node. To make it easier to work with the resulting data, I wanted to add a NodeJs library to the node. This library should be able to be included in the function node via setup, for example.
But the library is not found by the Node-RED. I always get this message:
Installation of module TestLib.js failed: module not found
Failed to load external modules required by this flow:
- TestLib.js [404]
In the package.json of the node I specified the library under the entry "main":
{
...
"main": "TestLib.js",
}, "node-red": {
...
},
...
}
The library currently contains only one test function with the following content:
TestLib.js:
function add(){
console.log("Hello World");
}
module.exports = add()
Is it at all possible to place a library and a node in the same package? If it is possible, what do I have to do to use the library in the function node?