OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Build fails on nodejs 10 #227

Closed Apollon77 closed 6 years ago

Apollon77 commented 6 years ago

see https://travis-ci.org/ioBroker/ioBroker.zwave/jobs/371390543#L623:

Basically it is error:

In file included from /home/travis/build/ioBroker/ioBroker.zwave/node_modules/nan/nan.h:192:0,
                 from ../src/openzwave.hpp:27,
                 from ../src/callbacks.cc:18:
/home/travis/build/ioBroker/ioBroker.zwave/node_modules/nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
/home/travis/build/ioBroker/ioBroker.zwave/node_modules/nan/nan_maybe_43_inl.h:112:15: error: ‘class v8::Object’ has no member named ‘ForceSet’
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
               ^

... and some more warnings

ekarak commented 6 years ago

this looks to be a NAN issue, try npm update before recompiling and please report on your findings

Apollon77 commented 6 years ago

i don't know what exactly you meaned with "npm update".. I fordked your project, added testing up to nodejs 10 and updated to very latest nan version in the deps. With this it works up to nodejs 9, nodejs 10 is broken ... https://travis-ci.org/Apollon77/node-openzwave-shared/jobs/371569281

Formally it is correct that Nan 2.10.0 says it is compatible up till nodejs 9.x ... so maybe Nan need to update again ?!

Now the error is about (at least seems to me):

../src/openzwave-values.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE OZW::OZW::SetValueLabel(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/openzwave-values.cc:105:36: error: no matching function for call to ‘v8::Value::ToNumber()’
   uint8 nodeid = info[0]->ToNumber()->Value();
                                    ^
../src/openzwave-values.cc:105:36: note: candidates are:
In file included from ../src/openzwave.hpp:26:0,
                 from ../src/openzwave-values.cc:18:
/home/travis/.node-gyp/10.0.0/include/node/v8.h:2366:44: note: v8::MaybeLocal<v8::Number> v8::Value::ToNumber(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
                                            ^
/home/travis/.node-gyp/10.0.0/include/node/v8.h:2366:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/travis/.node-gyp/10.0.0/include/node/v8.h:26:0,
                 from ../src/openzwave.hpp:26,
                 from ../src/openzwave-values.cc:18:
/home/travis/.node-gyp/10.0.0/include/node/v8.h:2383:35: note: v8::Local<v8::Number> v8::Value::ToNumber(v8::Isolate*) const
                     Local<Number> ToNumber(Isolate* isolate) const);
                                   ^
/home/travis/.node-gyp/10.0.0/include/node/v8config.h:340:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^
/home/travis/.node-gyp/10.0.0/include/node/v8.h:2383:35: note:   candidate expects 1 argument, 0 provided
                     Local<Number> ToNumber(Isolate* isolate) const);
                                   ^
codepeon commented 6 years ago

try https://github.com/OpenZWave/node-openzwave-shared/pull/229 it should fix the build error

Apollon77 commented 6 years ago

see comment on PR: worked https://travis-ci.org/Apollon77/node-openzwave-shared/builds/373208967

ekarak commented 6 years ago

version 1.4.2 released with NAN 2.10.0, resolving issue