Custom node not showing up in Manage Pallette

Hello
I have been struggling with this problem for a while.
Here is the summary:
-I have created a very small custom node.

  • Updated the package.json file
    -followed the instructions to create a custom node.
    -I have also "published them"
    -My package info and node-red start up logs are as below.

Problem is the node I have created does not show up in the palette for me to use create a flow out.

---
npm install node-red-contrib-test-phani1

added 1 package, and audited 6 packages in 733ms

found 0 vulnerabilities
/tmp/source_code$ node-red
31 Dec 17:49:21 - [info] 

Welcome to Node-RED
===================

31 Dec 17:49:21 - [info] Node-RED version: v2.1.4
31 Dec 17:49:21 - [info] Node.js  version: v17.3.0
31 Dec 17:49:21 - [info] Linux 5.11.0-43-generic x64 LE
31 Dec 17:49:21 - [info] Loading palette nodes
31 Dec 17:49:21 - [debug] Module: node-red-contrib-uibuilder 3.3.1    .node-red/node_modules/node-red-contrib-uibuilder
31 Dec 17:49:21 - [debug] Module: node-red-dashboard 2.29.0 /.node-red/node_modules/node-red-dashboard
31 Dec 17:49:21 - [debug] Module: node-red-node-ui-table 0.3.11 .node-red/node_modules/node-red-node-ui-table
31 Dec 17:49:21 - [debug] Module: pynodered 0.0.1 .node-red/node_modules/pynodered
31 Dec 17:49:21 - [info] +-----------------------------------------------------
31 Dec 17:49:21 - [info] | uibuilder initialised:
31 Dec 17:49:21 - [info] |   Using Node-RED's webserver
31 Dec 17:49:21 - [info] |   root folder: .node-red/uibuilder
31 Dec 17:49:21 - [info] |   version . .: 3.3.1
31 Dec 17:49:21 - [info] |   packages . : jquery,socket.io
31 Dec 17:49:21 - [info] +-----------------------------------------------------
31 Dec 17:49:21 - [info] Dashboard version 2.29.0 started at /ui


31 Dec 17:49:21 - [info] Settings file  : /.node-red/settings.js
31 Dec 17:49:21 - [info] Context store  : 'default' [module=memory]
31 Dec 17:49:21 - [info] User directory : /.node-red
31 Dec 17:49:21 - [warn] Projects disabled : editorTheme.projects.enabled=false
31 Dec 17:49:21 - [warn] Flows file name not set. Generating name using hostname.
31 Dec 17:49:21 - [info] Flows file     : /.node-red/flows_ajira-server.json
31 Dec 17:49:21 - [info] Creating new flow file
31 Dec 17:49:21 - [debug] loaded flow revision: d751713988987e9331980363e24189ce
31 Dec 17:49:21 - [debug] red/runtime/nodes/credentials.load : user provided key
31 Dec 17:49:21 - [debug] red/runtime/nodes/credentials.load : default key present. Will migrate
31 Dec 17:49:21 - [debug] red/runtime/nodes/credentials.load : keyType=user
31 Dec 17:49:21 - [info] Server now running at http://127.0.0.1:1880/
31 Dec 17:49:21 - [info] Starting flows
31 Dec 17:49:21 - [debug] red/nodes/flows.start : starting flow : global
31 Dec 17:49:21 - [info] Started flows
31 Dec 17:53:00 - [debug] red/runtime/nodes/credentials.export : encrypting
31 Dec 17:53:00 - [debug] red/runtime/nodes/credentials.export : removing unused default key
31 Dec 17:53:00 - [debug] saved flow revision: 0eec3f82b5c3ee80c644ce41d4ccba5c
31 Dec 17:53:00 - [info] Stopping flows
31 Dec 17:53:00 - [debug] red/nodes/flows.stop : stopping flow : global
31 Dec 17:53:00 - [info] Stopped flows
31 Dec 17:53:00 - [info] Starting flows
31 Dec 17:53:00 - [debug] red/nodes/flows.start : starting flow : global
31 Dec 17:53:00 - [debug] red/nodes/flows.start : starting flow : 674b9685ed7ada1f
31 Dec 17:53:00 - [info] Started flows

Replying so as to keep it clean.
The package.json file I have used contains the following:


  "name": "node-red-contrib-test-phani1",
  "version": "1.0.0",
  "description": "ajira",
  "node-red": {
    "nodes": {
      "capabilities": "capabilities.js"
    }
  },
  "dependencies": {
    "node-gyp-build": "^4.3.0",
    "node-red-contrib-test-phani1": "^1.0.0",
    "underscore": "^1.13.2",
    "uuid": "^7.0.0"
  },

Based on the above package.json file, I exepected a custom node called "capabilities" be made available in the palette. Obviously there are two files in the folder: capabilities.js and capabilities.html
I will post js file below.

capabilities.js file is:

module.exports = function(RED)
{
    var zerorpc = require("zerorpc");

    function CapabilitiesNode(config)
    {
        RED.nodes.createNode(this,config);
        var node = this;
        var inputs_passed = {};

        node.on('input', function(msg)
        {
            console.log(msg.payload);

            var client = new zerorpc.Client();

        });
    }
    RED.nodes.registerType("capabilities", CapabilitiesNode);
}

I believe you have installed your node inside /tmp/source_code$ instead of the .node-red directory.

You also appear to have your node listed as a dependency of itself. You shouldn't need to do that.

At a guess, the OPs SRC folder is where they ran npm install node-red-contrib-test-phani1 and now has itself as a dep?

One additional observation, it is not wise to store your development SRC in /tmp/. Depending on your OS, it will likely be deleted automatically at some point.

Sorry, one more observation...

You don't need to publish test projects (that will ultimately be left to rot) to npm. You can run npm install against your src directory and avoid publishing junk to npm

In your case, that would be (at a guess)...

cd /.node-red
npm install /tmp/source_code$
1 Like

thank you all.
Corrected all of them. It worked.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.