Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on NodeJS 13 #6

Open
foxt opened this issue Mar 3, 2020 · 3 comments
Open

Fails to build on NodeJS 13 #6

foxt opened this issue Mar 3, 2020 · 3 comments

Comments

@foxt
Copy link
Contributor

foxt commented Mar 3, 2020

macOS Catalina, Node 13.3.0

> [email protected] install /Users/thelmgn/Documents/file/node_modules/system-icon
> node-gyp rebuild

  CXX(target) Release/obj.target/addon/addon.o
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(Boolean)
^~~~~~~~~~
../../nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
      val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext())          \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2762:37: note: passing argument to parameter 'isolate' here
  Local<Boolean> ToBoolean(Isolate* isolate) const;
                                    ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../../nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
  return val->NAME ## Value(isolate->GetCurrentContext());                     \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2771:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
  return scope.Escape(v8::Function::New( isolate
                                         ^~~~~~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:189:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to
      'const v8::Local<v8::Context> &' for 1st argument
class Local {
      ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:189:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to
      'v8::Local<v8::Context> &&' for 1st argument
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:193:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against 'v8::Isolate *'
  V8_INLINE Local(Local<S> that)
            ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:4313:22: note: passing argument to parameter 'context' here
      Local<Context> context, FunctionCallback callback,
                     ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:5688:3: note: 'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
  ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:58: error: expected '(' for function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../nan/nan_implementation_12_inl.h:337:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
                                                           ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:179:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:99:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:172:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:99:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return node::MakeCallback(
                 ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:165:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:99:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:916:53: error: too few arguments to function call, single argument 'context' was not specified
      v8::Local<v8::String> string = from->ToString();
                                     ~~~~~~~~~~~~~~ ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2750:3: note: 'ToString' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
  ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8config.h:419:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:926:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'char *'
        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                    ^~~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2947:26: note: passing argument to parameter 'isolate' here
  int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
                         ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1478:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
    return scope.Escape(node::MakeCallback(
                              ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:179:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/node.h:99:20: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                   ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1538:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1544:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(key, value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1550:28: error: no matching member function for call to 'Set'
    New(persistentHandle)->Set(index, value);
    ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3547:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3550:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1556:32: error: no matching member function for call to 'Get'
        New(persistentHandle)->Get(New(key).ToLocalChecked()));
        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1562:48: error: no matching member function for call to 'Get'
    return scope.Escape(New(persistentHandle)->Get(key));
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
../../nan/nan.h:1567:48: error: no matching member function for call to 'Get'
    return scope.Escape(New(persistentHandle)->Get(index));
                        ~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3594:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:3597:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:2365:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../addon.cpp:1:
In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:2365:
../../nan/nan_object_wrap.h:67:18: error: no member named 'MarkIndependent' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    persistent().MarkIndependent();
    ~~~~~~~~~~~~ ^
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
../addon.cpp:18:53: error: too few arguments to function call, single argument 'context' was not specified
  v8::String::Utf8Value extension{info[0]->ToString()};
                                  ~~~~~~~~~~~~~~~~~ ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2750:3: note: 'ToString' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
  ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8config.h:419:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../addon.cpp:19:57: error: too few arguments to function call, single argument 'context' was not specified
  auto size = static_cast<IconSize>(info[1]->Int32Value());
                                    ~~~~~~~~~~~~~~~~~~~ ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8.h:2778:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/thelmgn/Library/Caches/node-gyp/13.3.0/include/node/v8config.h:419:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
make: *** [Release/obj.target/addon/addon.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:219:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/Cellar/node/13.3.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/thelmgn/Documents/file/node_modules/system-icon
gyp ERR! node -v v13.3.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /Users/thelmgn/.npm/_logs/2020-03-03T12_00_21_939Z-debug.log```
@foxt
Copy link
Contributor Author

foxt commented Mar 3, 2020

Also fails on Node 12.7:

In file included from ../system_icon.hpp:1:
In file included from ../../nan/nan.h:2365:
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object,
      v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
../addon.cpp:18:44: error: no matching member function for call to 'ToString'
  v8::String::Utf8Value extension{info[0]->ToString()};
                                  ~~~~~~~~~^~~~~~~~
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8.h:2535:44: note: candidate function not viable: requires single argument
      'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8.h:2551:31: note: candidate function not viable: requires single argument
      'isolate', but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../addon.cpp:19:57: error: too few arguments to function call, single argument 'context' was not specified
  auto size = static_cast<IconSize>(info[1]->Int32Value());
                                    ~~~~~~~~~~~~~~~~~~~ ^
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8.h:2576:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../addon.cpp:39:39: error: no matching member function for call to 'ToString'
  v8::String::Utf8Value path{info[0]->ToString()};
                             ~~~~~~~~~^~~~~~~~
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8.h:2535:44: note: candidate function not viable: requires single argument
      'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8.h:2551:31: note: candidate function not viable: requires single argument
      'isolate', but no arguments were provided
                Local<String> ToString(Isolate* isolate) const);
                              ^
../addon.cpp:40:57: error: too few arguments to function call, single argument 'context' was not specified
  auto size = static_cast<IconSize>(info[1]->Int32Value());
                                    ~~~~~~~~~~~~~~~~~~~ ^
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8.h:2576:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/thelmgn/.node-gyp/12.7.0/include/node/v8config.h:351:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
13 warnings and 12 errors generated.
make: *** [Release/obj.target/addon/addon.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:266:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.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 /Users/thelmgn/Documents/file/node_modules/system-icon
gyp ERR! node -v v12.7.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /Users/thelmgn/.npm/_logs/2020-03-03T12_13_04_353Z-debug.log```

@foxt
Copy link
Contributor Author

foxt commented Mar 3, 2020

I've tried to fix this in #7

@kassimir
Copy link

kassimir commented Apr 24, 2020

I've tried to fix this in #7

It installs on my Windows 10 Pro machine. Will be checking to see if it works now. Thanks!

EDIT: I'm getting "Error: Module did not self-register."

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

No branches or pull requests

2 participants