robertklep / homebridge-klikaanklikuit

Homebridge plugin for KlikAanKlikUit outlets
15 stars 7 forks source link

Ondersteuning node V20 #39

Open JRCKW opened 5 months ago

JRCKW commented 5 months ago

Hi Robert,

Na het updaten van Homebridge naar Node V20 (20.14.0) werkt de plugin niet meer. Nu ik probeer om de plugin opnieuw te installeren blijf ik errors krijgen. Heb jij een idee hoe ik dit kan oplossen?

> rpio@1.7.1 install
> node-gyp rebuild

make: Entering directory '/usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio/build'
  CXX(target) Release/obj.target/rpio/src/rpio.o
In file included from ../../nan/nan.h:176,
                 from ../src/rpio.cc:17:
../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                       ^~~~~~~~~~~~~~~~~
../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
   55 | typedef v8::Local<v8::AccessorSignature> Sig;
      |                                        ^
In file included from ../src/rpio.cc:17:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../../nan/nan.h:2549:16: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
 2549 |     , signature);
      |                ^
In file included from /home/pi/.cache/node-gyp/20.14.0/include/node/v8-function.h:15,
                 from /home/pi/.cache/node-gyp/20.14.0/include/node/v8.h:33,
                 from /home/pi/.cache/node-gyp/20.14.0/include/node/node.h:73,
                 from ../../nan/nan.h:56,
                 from ../src/rpio.cc:17:
/home/pi/.cache/node-gyp/20.14.0/include/node/v8-template.h:809:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  809 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/pi/.cache/node-gyp/20.14.0/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/20.14.0/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
  816 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/pi/.cache/node-gyp/20.14.0/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
  821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
      |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../nan/nan.h:56,
                 from ../src/rpio.cc:17:
../src/rpio.cc: At global scope:
/home/pi/.cache/node-gyp/20.14.0/include/node/node.h:1224:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
 1224 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/.cache/node-gyp/20.14.0/include/node/node.h:1258:3: note: in expansion of macro ‘NODE_MODULE_X’
 1258 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/rpio.cc:499:1: note: in expansion of macro ‘NODE_MODULE’
  499 | NODE_MODULE(rpio, setup)
      | ^~~~~~~~~~~
make: *** [rpio.target.mk:110: Release/obj.target/rpio/src/rpio.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Linux 5.15.32-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 /usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio
gyp ERR! node -v v20.14.0
gyp ERR! node-gyp -v v10.1.0
gyp ERR! not ok 
npm error code 1
npm error path /usr/local/lib/node_modules/homebridge-klikaanklikuit/node_modules/rpio
npm error command failed
npm error command sh -c node-gyp rebuild
robertklep commented 5 months ago

Ik vermoed dat één van de dependencies geupdate moet worden (waarschijnlijk nan), maar om eerlijk te zijn heb ik deze code al jaren niet meer aangeraakt en ik heb ook geen RPi meer waar ik het mee kan testen 🥴