Node red failing to install nodes

I had no issues with node-red addon until today. I did click the “Update Nodes” button that appeared and that seemed to be ok.

However, although I cannot be certain of timings, it may have been after this that installing nodes from the palette began to fail.

An example (and it is not the only one) is below:


-----------------------------------------------------------
2022-10-22T12:13:48.682Z Install : node-red-contrib-speedtest 1.1.0

2022-10-22T12:13:46.667Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-10-22T12:13:48.372Z [err] npm
2022-10-22T12:13:48.373Z [err]  WARN
2022-10-22T12:13:48.374Z [err]  config production Use `--omit=dev` instead.
2022-10-22T12:14:14.436Z [err] npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
2022-10-22T12:14:19.985Z [err] npm
2022-10-22T12:14:19.987Z [err]  
2022-10-22T12:14:19.989Z [err] ERR!
2022-10-22T12:14:19.990Z [err]  
2022-10-22T12:14:19.991Z [err] code
2022-10-22T12:14:19.994Z [err]  1
2022-10-22T12:14:19.996Z [err] npm
2022-10-22T12:14:19.997Z [err]  
2022-10-22T12:14:19.997Z [err] ERR!
2022-10-22T12:14:19.998Z [err]  
2022-10-22T12:14:19.999Z [err] path
2022-10-22T12:14:19.999Z [err]  /config/node-red/node_modules/lzma-native
2022-10-22T12:14:20.030Z [err] npm
2022-10-22T12:14:20.031Z [err]  
2022-10-22T12:14:20.032Z [err] ERR!
2022-10-22T12:14:20.032Z [err]  command failed
2022-10-22T12:14:20.033Z [err] npm
2022-10-22T12:14:20.034Z [err]  
2022-10-22T12:14:20.035Z [err] ERR!
2022-10-22T12:14:20.038Z [err]  
2022-10-22T12:14:20.039Z [err] command
2022-10-22T12:14:20.040Z [err]  sh -c node-pre-gyp install --fallback-to-build && rimraf build
2022-10-22T12:14:20.042Z [err] npm
2022-10-22T12:14:20.043Z [err]  
2022-10-22T12:14:20.044Z [err] ERR!
2022-10-22T12:14:20.045Z [err]  Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64/lzma_native.node --module_name=lzma_native --module_path=/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --python=/usr/bin/python3' (1)
2022-10-22T12:14:20.047Z [err] npm
2022-10-22T12:14:20.048Z [err]  
2022-10-22T12:14:20.048Z [err] ERR!
2022-10-22T12:14:20.050Z [err]  node-pre-gyp info it worked if it ends with ok
2022-10-22T12:14:20.050Z [err] npm ERR! node-pre-gyp info using [email protected]
2022-10-22T12:14:20.050Z [err] npm ERR! node-pre-gyp info using [email protected] | linux | arm64
2022-10-22T12:14:20.052Z [err] npm
2022-10-22T12:14:20.052Z [err]  
2022-10-22T12:14:20.053Z [err] ERR!
2022-10-22T12:14:20.055Z [err]  node-pre-gyp WARN Using request for node-pre-gyp https download 
2022-10-22T12:14:20.055Z [err] npm ERR! node-pre-gyp info check checked for "/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64/lzma_native.node" (not found)
2022-10-22T12:14:20.055Z [err] npm ERR! node-pre-gyp http GET https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v4.0.6-node-v93-linux-arm64.tar.gz
2022-10-22T12:14:20.055Z [err] npm ERR! node-pre-gyp http 404 https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v4.0.6-node-v93-linux-arm64.tar.gz
2022-10-22T12:14:20.055Z [err] npm ERR! node-pre-gyp WARN Tried to download(404): https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v4.0.6-node-v93-linux-arm64.tar.gz 
2022-10-22T12:14:20.055Z [err] npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v93 ABI, musl) (falling back to source compile with node-gyp) 
2022-10-22T12:14:20.055Z [err] npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-pre-gyp.addaleax.net/lzma-native/lzma_native-v4.0.6-node-v93-linux-arm64.tar.gz 
2022-10-22T12:14:20.055Z [err] npm ERR! gyp info it worked if it ends with ok
2022-10-22T12:14:20.056Z [err] npm ERR! gyp info using [email protected]
2022-10-22T12:14:20.056Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2022-10-22T12:14:20.056Z [err] npm ERR! gyp info ok 
2022-10-22T12:14:20.056Z [err] npm ERR! gyp info it worked if it ends with ok
2022-10-22T12:14:20.056Z [err] npm ERR! gyp info using [email protected]
2022-10-22T12:14:20.056Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2022-10-22T12:14:20.056Z [err] npm
2022-10-22T12:14:20.056Z [err]  ERR! gyp ERR! find Python 
2022-10-22T12:14:20.056Z [err] npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2022-10-22T12:14:20.056Z [err] npm
2022-10-22T12:14:20.057Z [err]  ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2022-10-22T12:14:20.057Z [err] npm ERR! gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error
2022-10-22T12:14:20.057Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2022-10-22T12:14:20.057Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used
2022-10-22T12:14:20.057Z [err] npm
2022-10-22T12:14:20.057Z [err]  ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2022-10-22T12:14:20.057Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2022-10-22T12:14:20.057Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2022-10-22T12:14:20.057Z [err] npm ERR! gyp ERR! find Python 
2022-10-22T12:14:20.058Z [err] npm ERR! gyp ERR! find Python **********************************************************
2022-10-22T12:14:20.058Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2022-10-22T12:14:20.058Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2022-10-22T12:14:20.058Z [err] npm ERR!
2022-10-22T12:14:20.058Z [err]  gyp ERR! find Python you can try one of the following options:
2022-10-22T12:14:20.058Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2022-10-22T12:14:20.058Z [err] npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2022-10-22T12:14:20.058Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2022-10-22T12:14:20.058Z [err] npm 
2022-10-22T12:14:20.059Z [err] ERR! gyp ERR! find Python - Set the npm configuration variable python:
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at:
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! find Python **********************************************************
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! find Python 
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! configure error 
2022-10-22T12:14:20.059Z [err] npm
2022-10-22T12:14:20.059Z [err]  ERR! gyp ERR! stack Error: Could not find any Python installation to use
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
2022-10-22T12:14:20.059Z [err] npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
2022-10-22T12:14:20.059Z [err] npm ERR!
2022-10-22T12:14:20.060Z [err]  gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
2022-10-22T12:14:20.060Z [err] npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
2022-10-22T12:14:20.060Z [err] npm ERR! gyp ERR! stack     at exithandler (node:child_process:406:5)
2022-10-22T12:14:20.060Z [err] npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
2022-10-22T12:14:20.061Z [err] npm
2022-10-22T12:14:20.061Z [err]  ERR! gyp ERR! System Linux 5.15.61-v8
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64/lzma_native.node" "--module_name=lzma_native" "--module_path=/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" "--python=/usr/bin/python3"
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! cwd /config/node-red/node_modules/lzma-native
2022-10-22T12:14:20.061Z [err] npm ERR!
2022-10-22T12:14:20.061Z [err]  gyp ERR! node -v v16.16.0
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! node-gyp -v v9.0.0
2022-10-22T12:14:20.061Z [err] npm ERR! gyp ERR! not ok 
2022-10-22T12:14:20.061Z [err] npm ERR! node-pre-gyp ERR! build error 
2022-10-22T12:14:20.061Z [err] npm
2022-10-22T12:14:20.062Z [err]  ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64/lzma_native.node --module_name=lzma_native --module_path=/config/node-red/node_modules/lzma-native/binding-v4.0.6-node-v93-linux-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93 --python=/usr/bin/python3' (1)
2022-10-22T12:14:20.062Z [err] npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/config/node-red/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
2022-10-22T12:14:20.062Z [err] npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
2022-10-22T12:14:20.062Z [err] npm ERR!
2022-10-22T12:14:20.062Z [err]  node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
2022-10-22T12:14:20.062Z [err] npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
2022-10-22T12:14:20.062Z [err] npm ERR! node-pre-gyp ERR! System Linux 5.15.61-v8
2022-10-22T12:14:20.062Z [err] npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/config/node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
2022-10-22T12:14:20.062Z [err] npm ERR!
2022-10-22T12:14:20.063Z [err]  node-pre-gyp ERR! cwd /config/node-red/node_modules/lzma-native
2022-10-22T12:14:20.063Z [err] npm ERR! node-pre-gyp ERR! node -v v16.16.0
2022-10-22T12:14:20.063Z [err] npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
2022-10-22T12:14:20.063Z [err] npm ERR!
2022-10-22T12:14:20.063Z [err]  node-pre-gyp ERR! not ok
2022-10-22T12:14:20.075Z [err] 
2022-10-22T12:14:20.076Z [err] npm ERR! A complete log of this run can be found in:
2022-10-22T12:14:20.077Z [err] npm ERR!     /root/.npm/_logs/2022-10-22T12_13_48_228Z-debug-0.log
2022-10-22T12:14:20.124Z rc=1

Not sure what to do. I am unsure about re-installing, even though I know export should save all my flows. However, I have created a lot of flows already, many working with installed nodes, and my concern is that a re-install may result in these working nodes failing to install, thus breaking all my current flows that work.

I have restarted Node Red but installs still fail.

Any help appreciated.

@frenck Is this a common issue? I tried to install a module in Node-red on HA-os and have the same issue.

it’s possible to add npm packages through the configuration tab of node-red in the add-on section of home assistant.

Hi guys, I have the exact same issue, palette manager throwing BADENGINE (got node v16, expects node 10…14). However I tried your suggestion above to install required node through the config tab

(for others reading this, just paste in the package name found on the node’s description page, right after npm install, like this:
image

I can confirm that workaround does the trick, but something most def is broken in Node Red’s palette manager as of NR13+ I’ve posted in other parts of the forum, however everyone is currently silent on this.

@frenck - any words of wisdom you would like to part with, good sir?

Noticed that my NR updated from 13.5.0 to 13.5.1 and suddenly I have the same issue. Unable to start in the same way.

Solved by reverting back to 13.5.0 with a backup. All works again.

I’ve been having issues trying to update any NR nodes. Below is the log results. Seems like node-red-node-email is showing up in every attempt. Wondering if that folder needs to be deleted?

-----------------------------------------------------------

2022-11-04T12:41:28.881Z Install : node-red-contrib-bigtimer 2.8.3

2022-11-04T12:41:29.849Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]

2022-11-04T12:41:32.751Z [err] npm
202-11-04T12:41:32.754Z [err]  
2022-11-04T12:41:32.754Z [err] WARN
2022-11-04T12:41:32.755Z [err]  
2022-11-04T12:41:32.755Z [err] config
2022-11-04T12:41:32.755Z [err]  production Use `--omit=dev` instead.
2022-11-04T12:41:35.145Z [err] npm
2022-11-04T12:41:35.145Z [err]  ERR! code ENOTEMPTY
2022-11-04T12:41:35.146Z [err] npm
2022-11-04T12:41:35.147Z [err]  ERR!
2022-11-04T12:41:35.147Z [err]  syscall rename
2022-11-04T12:41:35.147Z [err] npm ERR!
2022-11-04T12:41:35.148Z [err]  path
2022-11-04T12:41:35.148Z [err]  /config/node-red/node_modules/node-red-node-email
2022-11-04T12:41:35.148Z [err] npm ERR! dest /config/node-red/node_modules/.node-red-node-email-9kimBKpy
2022-11-04T12:41:35.149Z [err] npm ERR! errno
2022-11-04T12:41:35.149Z [err]  -39
2022-11-04T12:41:35.155Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/config/node-red/node_modules/node-red-node-email' -> '/config/node-red/node_modules/.node-red-node-email-9kimBKpy'
2022-11-04T12:41:35.161Z [err]
2022-11-04T12:41:35.162Z [err] npm ERR! A complete log of this run can be found in:
2022-11-04T12:41:35.162Z [err] npm ERR!     /root/.npm/_logs/2022-11-04T12_41_32_637Z-debug-0.log
2022-11-04T12:41:35.184Z rc=217

-----------------------------------------------------------
2022-11-04T12:49:05.730Z Install : node-red-contrib-home-assistant-websocket 0.46.2

2022-11-04T12:49:06.692Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-11-04T12:49:08.406Z [err] npm
2022-11-04T12:49:08.408Z [err]  WARN 
2022-11-04T12:49:08.408Z [err] config production Use `--omit=dev` instead.
2022-11-04T12:49:17.564Z [err] npm
2022-11-04T12:49:17.564Z [err]  ERR! code ENOTEMPTY
2022-11-04T12:49:17.565Z [err] npm ERR!
2022-11-04T12:49:17.565Z [err]  syscall rename
2022-11-04T12:49:17.565Z [err] npm ERR! path /config/node-red/node_modules/node-red-node-email
2022-11-04T12:49:17.566Z [err] npm ERR! dest /config/node-red/node_modules/.node-red-node-email-9kimBKpy
2022-11-04T12:49:17.566Z [err] npm ERR! errno
2022-11-04T12:49:17.567Z [err]  -39
2022-11-04T12:49:17.571Z [err] npm ERR! ENOTEMPTY: directory not empty, rename '/config/node-red/node_modules/node-red-node-email' -> '/config/node-red/node_modules/.node-red-node-email-9kimBKpy'
2022-11-04T12:49:17.577Z [err] 
2022-11-04T12:49:17.577Z [err] npm ERR! A complete log of this run can be found in:
2022-11-04T12:49:17.577Z [err] npm ERR!     /root/.npm/_logs/2022-11-04T12_49_08_302Z-debug-0.log
2022-11-04T12:49:17.612Z rc=217

I browsed to the \config\node-red\node_modules folder and renamed “node-red-node-email” to “node-red-node-email-bad”. I was then able to update the nodes…