"Error: ENOENT: no such file or directory" shows on log when opening DEBUG in new window

This happens in Node-RED v 1.0.6 and 1.1.0 - I didn't try it in earlier releases.
Reproducible on OS: macOS v10.14.6 and raspberry pi (buster)

Open the editor and go to the debug tab down the bottom right is the 'Open in new window' button. If you press it, the debug opens in the new window. If I look in the log I see:

1 Jul 07:32:33 - [info] Started flows
Error: ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/node-red/node_modules/@node-red/nodes/core/common/lib/debug/locales/editor'
Error: ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/node-red/node_modules/@node-red/nodes/core/common/lib/debug/locales/node-red'
Error: ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/node-red/node_modules/@node-red/nodes/core/common/lib/debug/locales/jsonata'
Error: ENOENT: no such file or directory, stat '/usr/local/lib/node_modules/node-red/node_modules/@node-red/nodes/core/common/lib/debug/locales/infotips'

Highly interesting, as I was looking at this part of the core code some 2 hours ago. Just reproduced this on 1.0.6 on raspbian stretch, let me take a dive to see if I can find the source. I think I spot what's going on, let me do a quick check.

Edit: Yep found it. The popup window for the debugger is including the core's red.js as it needs it, which includes the i18n code to get translations. Here's the relevant part of the source located: https://github.com/node-red/node-red/blob/7a3ead8f3b4bc6cc0833c2b058ab9be1769e10eb/packages/node_modules/%40node-red/editor-client/src/js/i18n.js#L22-L36
Then, when trying to get those files, it tries to get them through the address created: https://github.com/node-red/node-red/blob/7a3ead8f3b4bc6cc0833c2b058ab9be1769e10eb/packages/node_modules/%40node-red/editor-client/src/js/i18n.js#L75
Which then through a couple steps is resolved here: https://github.com/node-red/node-red/blob/7a3ead8f3b4bc6cc0833c2b058ab9be1769e10eb/packages/node_modules/%40node-red/runtime/lib/api/nodes.js#L364

Because of the non-root entry path, it somehow tries to resolve it in the directory that the debug window's popout files are located, and will fail to resolve the files in the i18n library as those paths do not exist. It appears the origin for all of this is on the apiRootUrl, but I'm not so sure yet on how to resolve this. Looks like a bug, and should probably be reported on Github.

I'll open an issue and refer bck to your explaination!

Issue created on GitHub: https://github.com/node-red/node-red/issues/2629

1 Like

I'm not sure if this is the same issue, but I've noticed the following error in the debug window:
image

I'm running on Win 10, v1.1.2 of Node-RED.

Try using NR 1.1.3

Hi @alex88 that looks like your flow is attempting to write to a text file that either doesnt exist or node-red doesnt have permission to write to.

The issue @zenofmud and @afelix discussed here are (I believe) an under-the-hood issue (that has been fixed) in node-red core & unrelated to your issue of a flow failing to update a text file.

However, I could be wrong :slight_smile:

1 Like

Don't have the option to:
image

You cant update node-red itself from within node-red.

Re-do the original installation to upgrade.

Doh!!!

Of course.

That fixed it. Thanks!