itsmepetrov / homebridge-zigbee

ZigBee Platform plugin for HomeBridge
https://itsmepetrov.github.io/homebridge-zigbee/
MIT License
106 stars 36 forks source link

homebridge-zigbee needs to be updated for Node v12 #52

Open mrdc opened 4 years ago

mrdc commented 4 years ago

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

mkellsy commented 4 years ago

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

> serialport@6.2.2 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 concentrate@0.2.3: 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: concentrate@0.2.3
npm WARN notsup Unsupported engine for dissolve@0.3.3: 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: dissolve@0.3.3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serialport@6.2.2 install: `prebuild-install || node-gyp rebuild`
npm ERR!
 Exit status 1
npm
ERR!

npm ERR! Failed at the serialport@6.2.2 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 serialport@6.2.2. There is a new version available 8.0.5, this seems to work in Node LTS.

markus-fischbacher commented 4 years ago

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

jonnycastaway commented 4 years ago

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 😉

halilaykent commented 4 years ago

I have the same problem too

DiPa2211 commented 4 years ago

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 serialport@8.0.6 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. + serialport@8.0.6 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?

markus-fischbacher commented 4 years ago

I‘m still waiting for the update 😉

mkellsy commented 4 years ago

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

halilaykent commented 4 years ago

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

jonnycastaway commented 4 years ago

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.

mkellsy commented 4 years ago

@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 commented 4 years ago

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.

markus-fischbacher commented 4 years ago

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

mkellsy commented 4 years ago

We have a script for that.

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

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

markus-fischbacher commented 4 years ago

@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
mkellsy commented 4 years ago

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

markus-fischbacher commented 4 years ago

Thanks, it worked! :)

halilaykent commented 4 years ago

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

jonnycastaway commented 4 years ago

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 ;-)

markus-fischbacher commented 4 years ago

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

mrdc commented 4 years ago

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?

iGranDav commented 4 years ago

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

markus-fischbacher commented 4 years ago

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

BobbySlope commented 4 years ago

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::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfo&)]’: ../../../../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::WeakCallbackInfo::Callback’ {aka ‘void ()(const v8::WeakCallbackInfo&)’} 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 concentrate@0.2.3: 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: concentrate@0.2.3 npm WARN notsup Unsupported engine for dissolve@0.3.3: 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: dissolve@0.3.3 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-aead-crypto@2.1.4 (node_modules/node-aead-crypto): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-aead-crypto@2.1.4 install: node lib/install.js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! serialport@6.2.2 install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the serialport@6.2.2 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

BobbySlope commented 4 years ago

serialport@6.2.2 is way behind. latest release 8.0.6 atm everything lower than 8.0.0 is no longer supported

clipse2004 commented 4 years ago

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 :)

manuchis commented 4 years ago

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