Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

unable to build native module on Node 12 #174

Closed
henderea opened this issue Apr 23, 2019 · 5 comments · Fixed by #181
Closed

unable to build native module on Node 12 #174

henderea opened this issue Apr 23, 2019 · 5 comments · Fixed by #181
Assignees

Comments

@henderea
Copy link

henderea commented Apr 23, 2019

NodeJS 12 seems to be out, but I'm having trouble installing keytar on ubuntu and mac.

There is no prebuilt binary, and I'm having trouble with the regular build, possibly because of some NodeJS C extension api updates?

Logs from installing a package that uses keytar are linked below:
Ubuntu 18.04 LTS (includes console output as a second file): https://gist.github.com/henderea/9869013dabf1711ca9bdd00a000ca148
macOS 10.14.4: https://gist.github.com/henderea/5e238114af39c079cc858c74adf9b676

@shiftkey
Copy link
Contributor

@henderea looks like there's some nan APIs that are no longer supported in Node 12:

https://gist.github.com/henderea/9869013dabf1711ca9bdd00a000ca148#file-console-output-log

../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::StringObject>::return_t Nan::imp::Factory<v8::StringObject>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:356:37: error: no matching function for call to ‘v8::StringObject::New(v8::Local<v8::String>&)’
   return v8::StringObject::New(value).As<v8::StringObject>();
                                     ^
In file included from /home/henderea/.node-gyp/12.0.0/include/node/node.h:63:0,
                 from ../../nan/nan.h:53,
                 from ../src/async.cc:4:
/home/henderea/.node-gyp/12.0.0/include/node/v8.h:5380:23: note: candidate: static v8::Local<v8::Value> v8::StringObject::New(v8::Isolate*, v8::Local<v8::String>)
   static Local<Value> New(Isolate* isolate, Local<String> value);
                       ^~~
/home/henderea/.node-gyp/12.0.0/include/node/v8.h:5380:23: note:   candidate expects 2 arguments, 1 provided
In file included from ../../nan/nan_new.h:189:0,
                 from ../../nan/nan.h:223,
                 from ../src/async.cc:4:
../../nan/nan_implementation_12_inl.h:356:58: error: expected primary-expression before ‘>’ token
   return v8::StringObject::New(value).As<v8::StringObject>();
                                                          ^
../../nan/nan_implementation_12_inl.h:356:60: error: expected primary-expression before ‘)’ token
   return v8::StringObject::New(value).As<v8::StringObject>();
                                                            ^
In file included from /home/henderea/.node-gyp/12.0.0/include/node/node_object_wrap.h:26:0,
                 from ../../nan/nan.h:55,
                 from ../src/async.cc:4:
../../nan/nan_object_wrap.h: In destructor ‘virtual Nan::ObjectWrap::~ObjectWrap()’:
../../nan/nan_object_wrap.h:24:25: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
     assert(persistent().IsNearDeath());
                         ^
../../nan/nan_object_wrap.h: In static member function ‘static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’:
../../nan/nan_object_wrap.h:127:26: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
     assert(wrap->handle_.IsNearDeath());
                          ^

I've opened #175 to confirm this isn't just you.

@shiftkey shiftkey changed the title Issue with node 12 unable to build native module on Node 12 Apr 23, 2019
@shiftkey
Copy link
Contributor

@henderea are you able to retest with v4.4.2 that I just published? I think the upgrade to nan might help build from source, but I can't generate a prebuild package for Windows currently because node-abi needs an update.

@shiftkey
Copy link
Contributor

Either v4.4.2 or v4.5.0 should do the trick to be able to build from source. I'm waiting on electron/node-abi#62 to then be able to consume the prebuild package on Node 12.

@henderea
Copy link
Author

Yep, both systems installed it successfully now. Thanks!

@shiftkey
Copy link
Contributor

v4.6.0 should now prebuild fine for Node 12

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants