Creating a node with dependency


#1

Hello, i'm new to Node-Red, and i'm trying to make a new node which is dependent on another module. Simply put, i'm trying to use the module (which works fine in pure Node) in Node-Red, but i'm getting an error "Waiting for missing types to be registered:" . I listed the original module as dependency in package.json (before this error was "unknown module").


#2

The easiest if probably to look to see how other nodes do it. Try looking at the node-red github pages


#3

With all respect, it is definitely not the easiest because i don't know which part of the package is responsible for the error.


#4

If the runtime has failed to load your node there will be an error in the Node-RED log at startup. That's your starting point for identifying the underlying issue.

To use another npm module in your node you need to include it in the dependencies section of its package.json file and remember to run npm install in the node's directory to actually get it installed.


#5

Many thanks. Everything is working now.
Turns out i have to install the original package not only in the node-red directory, but also in the new package directory. Interesting, but i have one more question now. After installation, i now have 65 packages in node_modules subdir of new module directory. Is it normal?


#6

I suspect you only need it to install it in the new package directory.