Skip to content

Installation fails on MacOS with node (12,14,16) #9

Description

@sfatzinger

Installation of this package is failing on macos monteray, I tried with node 12,14, and 16.

sfatzinger@IT-USA-VX6467 concept2-electron % npm install --save concept2

> node-hid@0.5.7 install /Users/sfatzinger/dev/projects/concept2-electron/node_modules/concept2/node_modules/node-hid
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.20.0 runtime=node arch=x64 platform=darwin)
  CC(target) Release/obj.target/hidapi/hidapi/mac/hid.o
clang: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/opt/homebrew/lib' [-Wunused-command-line-argument]
../hidapi/mac/hid.c:252:20: warning: comparison of integers of different signs: 'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (chars_copied == len)
                    ~~~~~~~~~~~~ ^  ~~~
1 warning generated.
  LIBTOOL-STATIC Release/hidapi.a
  CXX(target) Release/obj.target/HID/src/HID.o
../src/HID.cc:203:43: error: no matching member function for call to 'Get'
      Nan::GetCurrentContext()->Global()->Get(Nan::New<String>("Buffer").ToLocalChecked() )
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/HID.cc:207:45: error: no matching member function for call to 'NewInstance'
    Local<Object> buf = nodeBufConstructor->NewInstance(1, nodeBufferArgs);
                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:4454:44: note: candidate function not viable: requires single argument 'context', but 2 arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:4451:44: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
../src/HID.cc:231:20: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  iocb->_callback->Call(2, argv);
                   ^
../../../../nan/nan.h:1745:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../../../nan/nan.h:110:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/HID.cc:280:13: error: no matching member function for call to 'Set'
    retval->Set(i, Nan::New<Integer>(buff_read[i]));
    ~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3673: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,
                                    ^
../src/HID.cc:305:13: error: no matching member function for call to 'Set'
    retval->Set(i, Nan::New<Integer>(buff_read[i]));
    ~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3673: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,
                                    ^
../src/HID.cc:339:13: error: no matching member function for call to 'Set'
    retval->Set(i, Nan::New<Integer>(buf[i]));
    ~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3673: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,
                                    ^
../src/HID.cc:360:24: error: no matching member function for call to 'Get'
    if (!messageArray->Get(i)->IsNumber()) {
         ~~~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/HID.cc:363:53: error: no matching member function for call to 'Get'
    message.push_back((unsigned char) messageArray->Get(i)->Int32Value());
                                      ~~~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/HID.cc:404:46: error: too few arguments to function call, single argument 'context' was not specified
      int32_t vendorId = info[0]->Int32Value();
                         ~~~~~~~~~~~~~~~~~~~ ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:2869:40: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                       ^
../src/HID.cc:404:15: error: no viable conversion from 'Maybe<int32_t>' (aka 'Maybe<int>') to 'int32_t' (aka 'int')
      int32_t vendorId = info[0]->Int32Value();
              ^          ~~~~~~~~~~~~~~~~~~~~~
../src/HID.cc:405:47: error: too few arguments to function call, single argument 'context' was not specified
      int32_t productId = info[1]->Int32Value();
                          ~~~~~~~~~~~~~~~~~~~ ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:2869:40: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                       ^
../src/HID.cc:405:15: error: no viable conversion from 'Maybe<int32_t>' (aka 'Maybe<int>') to 'int32_t' (aka 'int')
      int32_t productId = info[1]->Int32Value();
              ^           ~~~~~~~~~~~~~~~~~~~~~
../src/HID.cc:409:37: error: no matching conversion for functional-style cast from 'v8::Local<v8::Value>' to 'v8::String::Value'
        serialPointer = (wchar_t*) *v8::String::Value(info[2]);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3317:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Value' for 1st argument
    Value(const Value&) = delete;
    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3310:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../src/HID.cc:443:37: error: too few arguments to function call, single argument 'context' was not specified
  blockStatus = info[0]->Int32Value();
                ~~~~~~~~~~~~~~~~~~~ ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:2869:40: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                       ^
../src/HID.cc:443:17: error: assigning to 'int' from incompatible type 'Maybe<int32_t>' (aka 'Maybe<int>')
  blockStatus = info[0]->Int32Value();
                ^~~~~~~~~~~~~~~~~~~~~
../src/HID.cc:468:26: error: no matching member function for call to 'Get'
      if (!messageArray->Get(i)->IsNumber()) {
           ~~~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/HID.cc:471:55: error: no matching member function for call to 'Get'
      message.push_back((unsigned char) messageArray->Get(i)->Int32Value());
                                        ~~~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
                                          ^
../src/HID.cc:504:17: error: no matching member function for call to 'Set'
    deviceInfo->Set(Nan::New<String>("manufacturer").ToLocalChecked(),
    ~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3673: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,
                                    ^
../src/HID.cc:508:17: error: no matching member function for call to 'Set'
    deviceInfo->Set(Nan::New<String>("product").ToLocalChecked(),
    ~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3673: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,
                                    ^
../src/HID.cc:512:17: error: no matching member function for call to 'Set'
    deviceInfo->Set(Nan::New<String>("serialNumber").ToLocalChecked(),
    ~~~~~~~~~~~~^~~
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/sfatzinger/Library/Caches/node-gyp/14.20.0/include/node/v8.h:3673: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,
                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/HID/src/HID.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/sfatzinger/.nvm/versions/node/v14.20.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/Users/sfatzinger/.nvm/versions/node/v14.20.0/bin/node" "/Users/sfatzinger/.nvm/versions/node/v14.20.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/sfatzinger/dev/projects/concept2-electron/node_modules/concept2/node_modules/node-hid
gyp ERR! node -v v14.20.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN concept2-electron@1.0.0 No description
npm WARN concept2-electron@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid@0.5.7 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-hid@0.5.7 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/sfatzinger/.npm/_logs/2022-09-12T21_17_52_983Z-debug.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions