hassio-addons/addon-node-red

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.


Sounds to me like you already had a node-red folder in your /config folder? Maybe from an older attempt? Try renaming that folder to something else. E.g.:

/config/node-red -> /config/node-red-old and restart the add-on.

posted by frenck over 5 years ago

It's looking like the issue was a dying SD card. HA wouldn't come up after restarting, and now I'm on a new card Node-RED installed perfectly. Thanks for the quick response.

posted by tiredjohn over 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

posted by addons-assistant[bot] over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests