Creating own node

Hi I have tried the example from the node red page for creating a node:

So far it worked but the node is shown in with a grey dash box.

Any idea what went wrong? I copied the example exaclty with no changes in it.

BR
Matthias

So you see anything in the node red log when you start node red? If not then check in the browser developer tools.

you mean the starting log?


I cant see any errors there regaring the new node

That is the wrong command. You have used node-red restart instead of node-red-restart. That is why it is saying that it is creating a new flows file (called restart as that is what your command told it to do). Try again and show us the full startup log.

If still no errors then check the browser developer tools as I suggested.

Edit: Please copy/paste the log, not screenshot.

I did what you say but still no errors. Where do I find the browser developer tools?

Welcome to Node-RED
===================
8 Jan 16:43:10 - [info] Node-RED version: v4.1.2
8 Jan 16:43:10 - [info] Node.js  version: v20.19.6
8 Jan 16:43:10 - [info] Linux 6.12.47+rpt-rpi-v8 arm64 LE
8 Jan 16:43:11 - [info] Loading palette nodes
8 Jan 16:43:15 - [info] Settings file  : /home/pi/.node-red/settings.js
8 Jan 16:43:15 - [info] Context store  : 'default' [module=memory]
8 Jan 16:43:15 - [info] User directory : /home/pi/.node-red
8 Jan 16:43:15 - [warn] Projects disabled : editorTheme.projects.enabled=false
8 Jan 16:43:15 - [info] Flows file     : /home/pi/.node-red/flows.json
8 Jan 16:43:15 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
8 Jan 16:43:15 - [warn] Encrypted credentials not found
8 Jan 16:43:15 - [info] Server now running at http://127.0.0.1:1880/
8 Jan 16:43:15 - [info] Starting flows
8 Jan 16:43:15 - [info] [ui-base:Mein Dashboard] Node-RED Dashboard 2.0 (v1.30.0) started at /dashboard
8 Jan 16:43:15 - [info] [ui-base:Mein Dashboard] Created socket.io server bound to Node-RED port at path /dashboard/socket.io
8 Jan 16:43:15 - [info] Started flows
8 Jan 16:43:15 - [info] [serialconfig:3f5f7abefeecf462] serial port /dev/ttyACM0 opened at 115200 baud 8N1

Admin edit: added triple backticks around the log to stop the forum from interpretting it as markdown.

For questions not related to node-red your favourite search engine is often the quickest way to ask such questions. How to open the browser developer tools depends on which browser you are using. Often it is F12, or look in the browser menus.

Open the console tab and refresh the page.

Sorry now I got what you mean. I thought there is a node red internal tool.

Once in the developer tools where should I look into? The console for errors or the source code?

Open the console and refresh the page.

I presume that there were no errors when you ran
npm install <path/to/node>

You mean like this:

But that's normal for a config node - at least that's what the "kafka-broker" in that image is, a config node meaning one that you can't add to the workspace.

And since it says 'deaktivieren" i.e. german for disbale, it must be enabled - so looks normal for me ...

But it isn't a config node.

@Matthias32 does it appear in the palette?

That’s the thing it does not appear in the palette.

Gesendet von Outlook für iOS

Set the log level to Trace in .node-red/settings.js (you should be able to find the right place) and restart node-red. That will give you much more information. Look for what it says about your node.

Also can you try a different browser?

That often means that you either didn't specify the correct name in your package.json under the Node-RED section or your .html and/or .js node definition files don't have the same name. The name must be the same in all places.

I tried but it didn't change anything

Thank you a lot. The log didn't show any errors regarding my noe.

what is the correct name for the pckage.json?
I copied the code from the node red example page. I expect the .htm and .js to be correct.

Here see my package.json. Maybe I did something wrong during the setup:

{
"name": "node-red-contrib-example-lower-case",
"version": "0.0.1",
"description": "A simple test node",
"dependencies": {
},
"keywords": [ "node-red" ],
"node-red" : {
"nodes": {
"lower-case": "lower-case.js"
}
}
}

Show us a directory listing of the folder containing the node's files.

sure. you mean like this?