Hi all,
I have written a node and released updates several times without issue. Now I want to update the module some more, but it has been a while. Anyway, long story short, when I use palette manager to install my node there are no issues. However, when I clone my github repository to my local RPi4 to modify the code (using VSCode) and try to install the modified node locally, suddenly I get the following error:
Welcome to Node-RED
===================
18 Nov 16:50:53 - [info] Node-RED version: v3.0.2
18 Nov 16:50:53 - [info] Node.js version: v16.20.2
18 Nov 16:50:53 - [info] Linux 6.1.21-v8+ arm LE
18 Nov 16:50:55 - [info] Loading palette nodes
redPlc rpi_mcp23008 driver V1.0.6 (c) Ocean iiot2k@gmail.com
18 Nov 16:50:56 - [info] Dashboard version 3.2.0 started at /ui
18 Nov 16:50:56 - [warn] ------------------------------------------------------
18 Nov 16:50:56 - [warn] [@joe-ab1do/mcp-pcf-aio/mcp-pcf-aio] Error: Cannot find module 'i2c-bus'
Require stack:
- /home/pi/dev/MCP230xx-PCF857x-AIO/mcp-pcf-aio.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
- /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
- /usr/lib/node_modules/node-red/lib/red.js
- /usr/lib/node_modules/node-red/red.js
18 Nov 16:50:56 - [warn] ------------------------------------------------------
18 Nov 16:50:56 - [info] Settings file : /home/pi/.node-red/settings.js
18 Nov 16:50:56 - [info] Context store : 'default' [module=memory]
18 Nov 16:50:56 - [info] User directory : /home/pi/.node-red
18 Nov 16:50:56 - [warn] Projects disabled : editorTheme.projects.enabled=false
18 Nov 16:50:56 - [info] Flows file : /home/pi/.node-red/flows.json
18 Nov 16:50:57 - [warn]
---------------------------------------------------------------------
The i2c-bus module is present in ~./node-red/node_modules. To be sure, I did npm-remove i2c-bus followed by npm-install i2c-bus, but same result. The node-red palette shows Module_Not_Found.
Using the palette manager, I can remove the node and successfully install the old (current) version from npm. I don't understand why suddenly the i2c-bus module cannot be found for the local node. I have changed nothing in the .js file.