Attempted to update NR (late at night) now nothing works (Solved)

I know I shouldn't do things like this late in the evening...
Previously working system:

15 Oct 23:59:55 - [info] Node-RED version: v0.19.1
15 Oct 23:59:55 - [info] Node.js  version: v6.11.4
15 Oct 23:59:55 - [info] Darwin 18.7.0 x64 LE

Ran sudo npm install -g --unsafe-perm node-red
That resulted in a screen full of errors, starting with these:

/usr/local/bin/node-red -> /usr/local/lib/node_modules/node-red/red.js
/usr/local/bin/node-red-pi -> /usr/local/lib/node_modules/node-red/bin/node-red-pi

> bcrypt@5.0.1 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! stack /usr/local/lib/node_modules/node-red/node_modules/detect-libc/lib/detect-libc.js:76
node-pre-gyp ERR! stack const family = async () => {
node-pre-gyp ERR! stack                      ^
node-pre-gyp ERR! stack 
node-pre-gyp ERR! stack SyntaxError: Unexpected token (
node-pre-gyp ERR! stack     at createScript (vm.js:56:10)
node-pre-gyp ERR! stack     at Object.runInThisContext (vm.js:97:10)
node-pre-gyp ERR! stack     at Module._compile (module.js:542:28)
node-pre-gyp ERR! stack     at Object.Module._extensions..js (module.js:579:10)
node-pre-gyp ERR! stack     at Module.load (module.js:487:32)
node-pre-gyp ERR! stack     at tryModuleLoad (module.js:446:12)
node-pre-gyp ERR! stack     at Function.Module._load (module.js:438:3)
node-pre-gyp ERR! stack     at Module.require (module.js:497:17)
node-pre-gyp ERR! stack     at require (internal/module.js:20:19)
node-pre-gyp ERR! stack     at Object.<anonymous> (/usr/local/lib/node_modules/node-red/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js:8:21)
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-red/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node-red/node_modules/bcrypt
node-pre-gyp ERR! node -v v6.11.4
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
npm WARN notsup Unsupported engine for node-red@3.0.2: wanted: {"node":">=14"} (current: {"node":"6.11.4","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: node-red@3.0.2

So i reasoned I needed to update node/npm:

jm:.node-red jm$ sudo npm rebuild

Lots of text, no obvious errors. Retry running NR:

jm:.node-red jm$ node-red

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/node-red/red.js:38:10)
jm:.node-red jm$


1 Like

Problem (apparently) resolved.

Downloaded and installed

	•	Node.js v16.18.0 to /usr/local/bin/node
	•	npm v8.19.2 to /usr/local/bin/npm

Now it looks like I'm back in business. Sorry for the fire alarm.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.