homebridge-zigbee icon indicating copy to clipboard operation
homebridge-zigbee copied to clipboard

homebridge-zigbee needs to be updated for Node v12

Open mrdc opened this issue 4 years ago • 27 comments

Hello,

Looks like homebridge-zigbee plugin needs to be updated for Nove v12, as it causes errors after installation on docker-homebridge with Node v12. Details: https://github.com/oznu/docker-homebridge/issues/250

mrdc avatar Nov 23 '19 08:11 mrdc

HOOBS runs on Node 12. I have a user that can't install the plugin. Here is the log output.

> [email protected] install /Users/mkellsy/.hoobs/node_modules/serialport
> prebuild-install || node-gyp rebuild
...
../src/serialport.cpp:460:43: error: expected ';' after top level declarator
  void init(v8::Handle<v8::Object> target) {
                                          ^
                                          ;
12 warnings and 9 errors generated.
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
gyp
 ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd ~/.hoobs/node_modules/serialport
gyp ERR!
 node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm
 WARN notsup Unsupported engine for [email protected]: wanted: {"node":"~0.10.0"} (current: {"node":"12.13.1","npm":"6.13.1"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"~0.10.0"} (current: {"node":"12.13.1","npm":"6.13.1"})
npm
WARN
 notsup Not compatible with your version of node/npm: [email protected]

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR!
 Exit status 1
npm
ERR!

npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm

ERR!
 A complete log of this run can be found in:
npm

ERR!
    ~/.npm/_logs/2019-11-27T17_10_20_764Z-debug.log

It looks like one of your deps is causing the issue [email protected]. There is a new version available 8.0.5, this seems to work in Node LTS.

mkellsy avatar Nov 27 '19 17:11 mkellsy

Upgrading serialport to 8.0.5 fixes the problem. Would be nice, if the maintainer could do that for us.

markus-fischbacher avatar Dec 13 '19 22:12 markus-fischbacher

I contacted the maintainer. He is a bit busy but will look at the problem next week. So i think he will contact us here 😉

jonnycastaway avatar Dec 15 '19 20:12 jonnycastaway

I have the same problem too

halilaykent avatar Dec 16 '19 21:12 halilaykent

I have the same problem. Did you find any other solution besides waiting for fixed version?

I tried to upgrade to serialport 8.0.6. However, that did not solve the problem

I installed serialport 8.0.6 and got this messages:

pi@raspberrypi:~ $ sudo npm install serialport --unsafe-perm --build-from-source [email protected] postinstall /home/pi/node_modules/serialport node thank-you.js npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json' npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json' npm WARN pi No description npm WARN pi No repository field. npm WARN pi No README data npm WARN pi No license field. + [email protected] updated 1 package and audited 553 packages in 3.965s found 0 vulnerabilities

Now I don't know whether it has been installed successfully? Can you give me any hints?

DiPa2211 avatar Dec 25 '19 23:12 DiPa2211

I‘m still waiting for the update 😉

markus-fischbacher avatar Dec 26 '19 09:12 markus-fischbacher

You can downgrade Node to 10.17.0. It installs in this version.

mkellsy avatar Dec 26 '19 18:12 mkellsy

@mkellsy But this time the homebridge config ui x wont work.

halilaykent avatar Dec 27 '19 09:12 halilaykent

You can downgrade Node to 10.17.0. It installs in this version.

That‘s not a solution if you use systems like Hoobs or a ready to go homebridge image.

The only right way is to actualize the plugin.

jonnycastaway avatar Dec 27 '19 16:12 jonnycastaway

@mkellsy But this time the homebridge config ui x wont work.

UI-X runs in 10.17.0, you need to uninstall it then reinstall it after you change the Node version.

sudo npm uninstall -g homebridge-config-ui-x

Then

sudo npm install -g --unsafe-perm homebridge-config-ui-x

mkellsy avatar Dec 27 '19 16:12 mkellsy

That‘s not a solution if you use systems like Hoobs or a ready to go homebridge image.

The only right way is to actualize the plugin.

I make the HOOBS img file, and as of 3.1.9 we are using 10.17.0, because many plugins don't support Node 12 yet.

mkellsy avatar Dec 27 '19 16:12 mkellsy

For those, who installed Hoobs 3 with Node 12, what is the best way to downgrade?

markus-fischbacher avatar Dec 27 '19 16:12 markus-fischbacher

We have a script for that.

wget -q -O - https://raw.githubusercontent.com/hoobs-org/HOOBS/master/clean.sh | sudo bash -

mkellsy avatar Dec 27 '19 17:12 mkellsy

Then i will test the downgrade after holidays. Hope that all will work.

jonnycastaway avatar Dec 27 '19 21:12 jonnycastaway

@mkellsy the downgrade unfortunately broke my HOOBS installation. It's not booting anymore. The cleanup script does not find npm.

main: line 66: npm: command not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
main: line 102: npm: command not found
main: line 103: npm: command not found
main: line 104: npm: command not found
Node  Installed
bash: line 188: npm: command not found
NPM Version 
Upgrading NPM
bash: line 195: npm: command not found
bash: line 196: npm: command not found
NPM  Installed
bash: line 206: npm: command not found
bash: line 207: npm: command not found

markus-fischbacher avatar Dec 27 '19 22:12 markus-fischbacher

Run it again. I added the -k flag to the curl command that downloads Node

mkellsy avatar Dec 27 '19 22:12 mkellsy

Thanks, it worked! :)

markus-fischbacher avatar Dec 27 '19 22:12 markus-fischbacher

Yes, Finally managed to make it work. However, my bulb was not a supperted device :( Unrecognized device: 0x00158d0002c65f0d LUMI lumi.light.aqcn02

halilaykent avatar Dec 27 '19 23:12 halilaykent

So, one day before christmas the maintainer release a new npm plugin: zigbee v2 I installed it and all is working. If anyone will test ;-)

jonnycastaway avatar Jan 01 '20 22:01 jonnycastaway

@jonnycastaway nice 👍🏻 Which Zigbee adapter do you use?

markus-fischbacher avatar Jan 01 '20 23:01 markus-fischbacher

So, one day before christmas the maintainer release a new npm plugin: zigbee v2 I installed it and all is working. If anyone will test ;-)

Is it updatable via Homebridge GUI? Or manual installation?

mrdc avatar Jan 02 '20 13:01 mrdc

https://www.npmjs.com/package/homebridge-zigbee-v2 has the same error for me :(

iGranDav avatar Jan 14 '20 14:01 iGranDav

I switched to RaspBee and homebridge-hue in combination with HOOBS. It's working perfectly.

markus-fischbacher avatar Jan 15 '20 21:01 markus-fischbacher

Issue still exists, look like the installation fails on serialport install script.

Tried on Node 12.14.1 and 10.17.0

/tmp/.node-gyp/12.14.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’: ../../../../nan/nan_object_wrap.h:65:61: required from here /tmp/.node-gyp/12.14.0/include/node/v8.h:10004:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type] make: *** [serialport.target.mk:110: Release/obj.target/serialport/src/serialport.o] Error 1 make: Leaving directory '/home/hoobs/.hoobs/node_modules/cc-znp/node_modules/serialport/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:210:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Linux 4.19.58-v7+ gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/hoobs/.hoobs/node_modules/cc-znp/node_modules/serialport gyp ERR! node -v v12.14.0 gyp ERR! node-gyp -v v5.0.5 gyp ERR! not ok npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"~0.10.0"} (current: {"node":"12.14.0","npm":"6.13.6"}) npm WARN notsup Not compatible with your version of node/npm: [email protected] npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"~0.10.0"} (current: {"node":"12.14.0","npm":"6.13.6"}) npm WARN notsup Not compatible with your version of node/npm: [email protected] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/node-aead-crypto): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node lib/install.js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

BobbySlope avatar Jan 26 '20 09:01 BobbySlope

[email protected] is way behind. latest release 8.0.6 atm everything lower than 8.0.0 is no longer supported

BobbySlope avatar Jan 26 '20 09:01 BobbySlope

Any News for this? I use hoobs and today I bought a Zigbee Stick to integrate my Aqara things. But first we need a working plugin :)

clipse2004 avatar May 26 '20 04:05 clipse2004

I updated serialport to v9.0.0 and still getting the same error.

manuchis avatar Jun 07 '20 08:06 manuchis