I have embedded nodered in electron app.
Have started the node red. ( programmatically using RED.start()), now i want to restart it.
trying to use RED.stop.then(()=>RED.start());
it is giving error like
Potentially unhandled rejection  TypeError: Cannot read property 'forEach' of undefined
at Object.addModule (...\node_modules@node-red\registry\lib\registry.js:199:27)
It seems it is trying to load opcua node modules and it is giving this error.
When node red started first time programmatically, i didn't get this error, when i stop and then start I get this error.
Can idea how to handle this
- Any other way to restart node red programmatically?
- Am i doing anything wrong? please correct me