Support nodejs 12
Apollon77 opened this issue · comments
Current build errors:
../src/node_snap7_client.cpp: In static member function ‘static void node_snap7::S7Client::Init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’:
../src/node_snap7_client.cpp:697:43: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
Nan::Set(target, name, tpl->GetFunction());
^
../src/node_snap7_client.cpp:697:43: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
from ../src/node_snap7_client.h:10,
from ../src/node_snap7_client.cpp:6:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
../src/node_snap7_client.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE node_snap7::S7Client::New(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/node_snap7_client.cpp:710:53: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
Nan::NewInstance(constructorHandle->GetFunction()).ToLocalChecked());
^
../src/node_snap7_client.cpp:710:53: note: candidate is:
In file included from /home/travis/.node-gyp/12.1.0/include/node/node.h:63:0,
from ../src/node_snap7_client.h:10,
from ../src/node_snap7_client.cpp:6:
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)
V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
^
/home/travis/.node-gyp/12.1.0/include/node/v8.h:5947:46: note: candidate expects 1 argument, 0 provided
make: *** [Release/obj.target/node_snap7/src/node_snap7_client.o] Error 1
Hi @Apollon77 . I'll have a look in the next days. Shouldn't be hard to fix. I'm currently rewriting this module for NAPI in my rare spare-time, so in the future major version changes will be less error-prone.
Thank you very much. I know that these changes are a pain ... I also have one „binary package“ Modul to maintain :-(
@mathiask88 FYI (because I got a build failure notification from AppVeyor for this project for some reason): node 12 is not supported yet, but there's a workaround: appveyor/ci#2921 (comment)
@vweevers It is no real "workaround" Update-NodeJsInstallation
did always pull a fresh version and Install-Product
selects a preinstalled version. The preinstalled versions lag, but I have the time to wait. However thanks for being attentive! :) I don't know why you got the notifications. Maybe because prebuild
used my appveyor account in the past.
I decided for ourt perojects to switch to the "workaround method". I'm better with "latest from a certain version chain" then some old stuff, so I can tell the customers "update your node" first ...
AppVeyor now has node v12 in their build images, but to be future-proof see 6738c97 :)