ebaauw / homebridge-nb

Homebridge plugin for Nuki Bridge
Apache License 2.0
51 stars 3 forks source link

installation fails with nodejs version 16 #96

Closed eeedean closed 1 year ago

eeedean commented 1 year ago

Hello,

the official ioBroker docker image uses nodejs version 16, since they recommend using that version.

Unfortunately the latest version of homebridge-nb does require version 18.13.0 at minimum resulting in following error output:

2023-01-25 19:50:08.618  - info: ham.0 (1734) npm install homebridge-nb --production  --loglevel error (System call)
2023-01-25 19:50:09.536  - info: ham.0 (1734) npm
2023-01-25 19:50:09.536  - info: ham.0 (1734)  ERR! code EBADENGINE

2023-01-25 19:50:09.537  - info: ham.0 (1734) npm ERR!
2023-01-25 19:50:09.538  - info: ham.0 (1734)  engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: homebridge-nb@1.3.1
npm ERR! notsup Not compatible with your version of node/npm: homebridge-nb@1.3.1
npm ERR! notsup Required: {"homebridge":"^1.6.0","node":"^18.13.0"}
npm ERR! notsup Actual:   {"npm":"8.19.3","node":"v16.19.0"}

2023-01-25 19:50:09.539  - info: ham.0 (1734)

2023-01-25 19:50:09.540  - info: ham.0 (1734) npm ERR! A complete log of this run can be found in:
npm ERR!     /opt/iobroker/.npm/_logs/2023-01-25T18_50_08_842Z-debug-0.log

2023-01-25 19:50:09.546  - error: ham.0 (1734) Error: Library homebridge-nb not installed after 3 attempts 

Is there any chance to require a lower node version <=16.15.0 ?

Thanks in advance Dean

ebaauw commented 1 year ago

I develop and test my plugins against the latest LTS version of NodeJS. That’s the version listed in package.json. They might or might not run on other versions; I simply don’t have the bandwidth to test nor support these.

eeedean commented 1 year ago

Thanks so much for your time and consideration.

If anyone else falls into my scenario, running the official ioBroker docker container, therefore being stuck on Version 16 of node, you can give it an unsupported shot by manually installing the plugin.

Simply move the git repository into the "node_modules" directory, which might be /opt/iobroker/node_modules/iobroker.ham/noide_modules. Afterwards add to the homebridge adapters package.json (which might be at /opt/iobroker/node_modules/iobroker.ham/package.json) the dependency like that:

  "dependencies": {
    [...] 
    "homebridge-nb": "^1.3.1",
    [...] 
  },

Restart and good luck.

As pointed out by @ebaauw, that might or might not work. At least in my setup with node 16.15.0 it works flawlessly.