How to disable Nodes when embedding?

171 views
Skip to first unread message

mw75

unread,
Apr 5, 2017, 2:29:21 AM4/5/17
to Node-RED
I embed Node-Red and would like to disable some core nodes.

I tried:

RED.start().then(function(){
        RED
.nodes.disableNode('node-red/tail');
        RED
.nodes.disableNode('node-red/file');
        RED
.nodes.disableNode('node-red/exec');
        RED
.nodes.disableNode('node-red/rpi-gpio');
        RED
.nodes.disableNode('node-red/watch');
});


But the flow seems not to be loaded when the promise resolves and so i get 
Potentially unhandled rejection [1] TypeError: Cannot read property 'flows' of null


when the In-use-check is running.

Any hint would be helpful!

Regards,
Mario

Glenn

unread,
Apr 5, 2017, 4:19:49 AM4/5/17
to Node-RED
You can disable nodes in the ui. I think it was under palettes or something

Nick O'Leary

unread,
Apr 5, 2017, 4:30:37 AM4/5/17
to Node-RED Mailing List
Hi Mario,

please can you raise an issue - there are a few parts of the API that would make sense to allow before the flow engine has started, such as this. We need to review to see what needs doing to support this.

In the meantime, you can use the `nodeExcludes` setting to prevent Node-RED from loading certain files. It works at either the node-module or file name level - not at the node-set level (eg node-red/exec). For example, you can see how we disable certain core nodes when running in Bluemix: https://github.com/ibmets/node-red-bluemix-starter/blob/35b94a6c50a71daa4654168412d8c93f861d5d1a/bluemix-settings.js#L44


Nick

On 5 April 2017 at 09:19, Glenn <glo...@gmail.com> wrote:
You can disable nodes in the ui. I think it was under palettes or something

--
http://nodered.org

Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send an email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/0f23fef1-7bfc-4cbf-83f4-1bdeeed60094%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mw75

unread,
Apr 5, 2017, 7:07:17 AM4/5/17
to Node-RED
Hi Nick,

Thank you very much for the nodeExcludes hint! That does the job really well!

@Glenn "Manage palette" is disabled in my setup!

Issue is raised!

Thanks once more!

Regards,
Mario
Reply all
Reply to author
Forward
0 new messages