hassio-addons/addon-node-red



The issue has been closed
Fresh install, error when starting: Cannot find module 'find-npm-prefix' #280
tiredjohn posted onGitHub
Problem/Motivation
A fresh Node-RED installation gets stuck in a loop while trying to start up - each time producing an error: "Cannot find module 'find-npm-prefix'".
Add-on log
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...
-----------------------------------------------------------
Hass.io Add-on: Node-RED
Flow-based programming for the Internet of Things
-----------------------------------------------------------
Add-on version: 4.0.6
You are running the latest version of this add-on.
System: HassOS 2.12 (armv7 / raspberrypi3)
Home Assistant version: 0.96.5
Supervisor version: 170
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing...
[21:41:56] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[21:41:58] INFO: Password is NOT in the Have I Been Pwned database! Nice!
patching file nodes/ui_base.html
Hunk #1 succeeded at 530 (offset -1 lines).
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] user.sh: executing...
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:41:59] INFO: Starting Node-RED...
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'find-npm-prefix'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/lib/node_modules/npm/lib/config/load-prefix.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[21:42:00] INFO: Starting Node-RED...
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'find-npm-prefix'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/lib/node_modules/npm/lib/config/load-prefix.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[21:42:01] INFO: Starting Node-RED...
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'find-npm-prefix'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/lib/node_modules/npm/lib/config/load-prefix.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[21:42:02] INFO: Starting Node-RED...
Config file (tokens and passwords are gibberish for testing)
{
"credential_secret": "3nf903k93mc93",
"dark_mode": false,
"http_node": {
"username": "test",
"password": "jh45h4h5haaaaa45"
},
"http_static": {
"username": "test",
"password": "jh45h4h5haaaaa45"
},
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"require_ssl": true,
"system_packages": [],
"npm_packages": [],
"init_commands": []
}
Expected behavior
Node-RED to start successfully.
Actual behavior
Gets stuck in an error loop.
Steps to reproduce
This is a fresh 4.0.6 Node-RED installation from the Hass.io Add-on store (this community repo), Home Assistant version 0.96.4. (On a Pi 3+)
After installing from the add-on store, I set the config to as you can see pasted above, started it, and the problem occurs. Any help would be appreciated.