Search code examples
npmraspberry-pinode-red

Unable to place a node in Node-RED


I have created a node, lets name it A.

Now I have successfully imported this into Node-Red on my raspberry pi using npm link A in the directory where the package.json file is, and gone to the Node-Red directory (~/.node-red), and used npm link A.

I say that I've successfully imported because when I go to the Manage Palette menu, the node is listed there. However, it's not located in the menu to the left, so I can't use the node.

Is there a straightforward way to fix this, or is this an indication that there is something wrong with the node itself (such as a syntax error or a faulty dependency)?


Solution

  • Node-RED will tell you which nodes it discovered but failed to load in the log at start up. It may show a useful error there, but it may just say it has failed to load.

    The easiest way to check for basic syntax errors is to manually load them into nodejs. To do this in the directory with the node's .js file run the following:

    $ node
    > require('./foo.js')
    

    (assuming the node's .js file is foo.js)