Electron + Node-RED = Palette editor disabled

Hello everybody,

I'm currently trying to get Node-RED (0.20.7) to run inside Electron (6.0.1).

I use the embedding example code inside the main process:
https://nodered.org/docs/user-guide/runtime/embedding

When I use Electron in dev-mode (npm start), everything works as intended.

But if I build the app for Mac, everything works except for the palette editor, which is not displayed to me. In the console, there is a log: "palette editor disabled". Unfortunately, I don't get more detailed logs from Node-RED in the built version.

I read that the "palette editable" settings will be overwritten / set to false if node-RED does not find npm.
Does anyone have some idea how I can get the palette editor displayed in the built version? Or can manually pass the path to npm?

Thank you so much,
Max

Have you had a look at similar projects?

Hi rei_vilo,
I tried the 2 projects, and with dceejays the same problem occurs, only with sakazuki's version it seems to work, but he has structured everything very differently and doesn't use the embedded code structure of the Node-RED documentation. So maybe it doesn't work with the embedded code example.

Thank you,
Max

I was able to solve this in a way, by adding this piece of code to the beginning of the main electron process:

if (process.platform == 'darwin') {
  process.env.PATH = [
    './node_modules/.bin',
    './node_modules',
    '/usr/local/bin',
    process.env.PATH
  ].join(':');
}

Is it really darwin specific ? or should/could a more general solution be proposed ?

Any solution that is more generic would also have to handle modules with binary components. They have to be rebuilt against the electron version of Node, not whatever version of Node may be installed on the system.

well yes for totally general case yes - but just for projects you just need access to git don't you ?

No, but this thread is about the palette manager.

the issue is only in darwin, I was able to make it work in windows.

I'm facing this exact issue right now, I have a workaround by changing part of the code in the install.js but I think there's more elegant ways to sort this.