lopelex / node-red-contrib-harmony

Node-RED integration for Harmony hub
MIT License
13 stars 6 forks source link

Unable to update to 2.2.1 #9

Closed jimmyeao closed 4 years ago

jimmyeao commented 4 years ago

Running Nodered inside docker on Hassio and trying to upgrade via palette manager:

-----------------------------------------------------------
2020-01-28T14:12:25.959Z Install : node-red-contrib-harmony-websocket 2.2.1

2020-01-28T14:12:26.780Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-harmony-websocket@2.2.1
2020-01-28T14:12:41.833Z [err] npm
2020-01-28T14:12:41.833Z [err]  WARN ifttt@0.1.2 requires a peer of express@~4.16 but none is installed. You must install peer dependencies yourself.
2020-01-28T14:12:41.833Z [err] 
2020-01-28T14:12:41.904Z [err] npm ERR!
2020-01-28T14:12:41.904Z [err]  code EEXIST
2020-01-28T14:12:41.904Z [err] npm ERR! path /config/node-red/node_modules/.bin/gulp
2020-01-28T14:12:41.904Z [err] npm ERR!
2020-01-28T14:12:41.904Z [err]  Refusing to delete /config/node-red/node_modules/.bin/gulp: is outside /config/node-red/node_modules/gulp and not a link
2020-01-28T14:12:41.904Z [err] npm 
2020-01-28T14:12:41.904Z [err] ERR! File exists: /config/node-red/node_modules/.bin/gulp
2020-01-28T14:12:41.904Z [err] npm 
2020-01-28T14:12:41.904Z [err] ERR!
2020-01-28T14:12:41.904Z [err]  Remove the existing file and try again, or run npm
2020-01-28T14:12:41.904Z [err] npm
2020-01-28T14:12:41.904Z [err]  ERR!
2020-01-28T14:12:41.904Z [err]  with --force to overwrite files recklessly.
2020-01-28T14:12:41.944Z [err] 
2020-01-28T14:12:41.944Z [err] npm ERR! A complete log of this run can be found in:
2020-01-28T14:12:41.944Z [err] npm ERR!
2020-01-28T14:12:41.944Z [err]      /root/.npm/_logs/2020-01-28T14_12_41_920Z-debug.log
2020-01-28T14:12:41.955Z rc=1
lopelex commented 4 years ago

try this https://stackoverflow.com/a/46541654.

jimmyeao commented 4 years ago

Tried deleting the node modules inside the harmony-websocket folder; fails with the same error. Even tried deleting the whole harmony-websocket folder, but node-red just recreates it when it restarts Tried installing it manually inside the docker:

root@a0d7b954-nodered:/opt$ npm install --no-audit --no-update-notifier --save --save-prefix="~" --production                                                                                   node-red-contrib-harmony-websocket@2.2.1

> bcrypt@3.0.6 install /opt/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-x64-musl.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.14.0 (node-v72 ABI, musl) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Linux 4.19.0-6-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/opt/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/opt/node_modules/bcrypt/lib/binding" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /opt/node_modules/bcrypt
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
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 build --fallback-to-build --module=/opt/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/opt/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/opt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 4.19.0-6-amd64
node-pre-gyp ERR! command "/usr/bin/node" "/opt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /opt/node_modules/bcrypt
node-pre-gyp ERR! node -v v12.14.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/opt/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/opt/node_modules/bcrypt/lib/binding --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)

> websocket@1.0.31 install /opt/node_modules/harmony-websocket/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

> websocket@1.0.31 install /opt/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

> fast-xml-parser@3.16.0 postinstall /opt/node_modules/fast-xml-parser
> node tasks/postinstall.js || exit 0

Love fast-xml-parser? Check https://amitkumargupta.work for more projects and contribution.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bcrypt@3.0.6 (node_modules/bcrypt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bcrypt@3.0.6 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ node-red-contrib-harmony-websocket@2.2.1
added 491 packages from 887 contributors in 24.443s

20 packages are looking for funding
  run `npm fund` for details
lopelex commented 4 years ago

https://github.com/socketio/socket.io/issues/1126#issuecomment-11872358

lopelex commented 4 years ago

You don't have to run npm install socket.io, of course.

lopelex commented 4 years ago

Is your problem solved?

jimmyeao commented 4 years ago

Sadly not, I still get the same error :(

jimmyeao commented 4 years ago

I should note, other modules upgrade fine, from the error it seems to be complaining about "ERR! path /config/node-red/node_modules/.bin/gulp"

-----------------------------------------------------------
2020-02-11T09:39:46.223Z Install : node-red-contrib-harmony-websocket 2.2.1

2020-02-11T09:39:46.700Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-harmony-websocket@2.2.1
2020-02-11T09:40:10.148Z [err] npm
2020-02-11T09:40:10.148Z [err]  WARN ifttt@0.1.2 requires a peer of express@~4.16 but none is installed. You must install peer dependencies yourself.
2020-02-11T09:40:10.148Z [err] 
2020-02-11T09:40:10.222Z [err] npm ERR!
2020-02-11T09:40:10.222Z [err]  code EEXIST
2020-02-11T09:40:10.222Z [err] npm ERR! path /config/node-red/node_modules/.bin/gulp
2020-02-11T09:40:10.222Z [err] npm 
2020-02-11T09:40:10.222Z [err] ERR! Refusing to delete /config/node-red/node_modules/.bin/gulp: is outside /config/node-red/node_modules/gulp and not a link
2020-02-11T09:40:10.222Z [err] npm
2020-02-11T09:40:10.222Z [err]  ERR! File exists: /config/node-red/node_modules/.bin/gulp
2020-02-11T09:40:10.222Z [err] npm
2020-02-11T09:40:10.222Z [err]  ERR! Remove the existing file and try again, or run npm
2020-02-11T09:40:10.222Z [err] npm ERR! with --force to overwrite files recklessly.
2020-02-11T09:40:10.297Z [err] 
2020-02-11T09:40:10.297Z [err] npm ERR! A complete log of this run can be found in:
2020-02-11T09:40:10.297Z [err] npm ERR!     /root/.npm/_logs/2020-02-11T09_40_10_239Z-debug.log
2020-02-11T09:40:10.319Z rc=1

this is the offending directory: image

gulp is not a sym link, not sure why the upgrade is trying to remove this? The contents of gulp are: image

lopelex commented 4 years ago

Try to delete or rename the glup file by hand. It seems npm cannot overwrite the file.

jimmyeao commented 4 years ago

ok, thanks for the pointers! so i got the update working by removing:

/config/node-red/node_modules/gulp/node_modules/.bin/gulp /config/node-red/node_modules/.bin/color-support /config/node-red/node_modules/.bin/atob

it then updated successfully

lopelex commented 4 years ago

Cool