Open tve opened 1 year ago
Looking in the container:
bash-5.1$ pwd
/usr/src/node-red
bash-5.1$ find . -name registry
./node_modules/@node-red/registry
I ended up patching get_require_path to simply return:
let rm = require.main.path;
rm = rm.replace(/node_modules.*/, '')
return rm + req_path
This got me through the require issue and now NR starts fine.
A few comments - without being sure they're truly relevant:
-v $PWD/node-red-mcu-plugin:/usr/src/node-red/node-red-mcu-plugin \
This looks like node-red-mcu-plugin
is not installed (or mapped) into the <userdir>/node_modules
folder - despite it should be.
bash-5.1$ pwd /usr/src/node-red bash-5.1$ find . -name registry ./node_modules/@node-red/registry
The location of the registry
folder as well looks "non-standard". How did you install node-red
... and how did you determine the path to map it to for the container?
require.main.path: /usr/src/node-red/node_modules/node-red
Your system expects to exists under the shown require.main.path
- whereas it looks like it is mapped to /usr/src/node-red
.
I'm using the official docker images. Node-RED is installed in /usr/src/node-red and that's ~node-red ($HOME). The user dir is /data. Node-RED has two node_modules directories: the one where it itself is installed (/usr/src/node-red/node_modules) and in the user dir (/data/node_modules). For a npm install it's common to use the home dir. If you install something within the node-red flow editor using the palette manager then it goes into the user dir's node_modules.
The installation of Node-RED is basically:
Maybe what causes the problem is the way node-red is started:
node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS
See the package.json file's start command. Just in case it's not clear, node-red-mcu-plugin ends up in /usr/src/node-red/node_modules/@ralphwetzel/node-red-mcu-plugin
Thank you for this data. I'll update the plugin so that this standard container should be recognized & supported by default. This yet doesn't solve the issue w/ xsbug & the sim.
Linux Arch x64, running node-red in docker, only installing node-red-mcu-plugin:
The script to launch the container is below. I have the modaable SDK installed and node-red-mcu-plugin checked out and I map both of these into the docker container.