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

Error while installing: "HID.cc:207:45: error: no matching member function for call to 'NewInstance'" #7

Closed
HansVanEijsden opened this issue Jun 24, 2018 · 2 comments
Assignees

Comments

@HansVanEijsden
Copy link

HansVanEijsden commented Jun 24, 2018

Hi there,
First of all thanks for the package. It looks great because I would like to adjust the master volume via the command line (iMac via SSH -> Domoticz & HomeBridge -> Apple Watch & HomeKit automation with audio sensors).
Unfortunately I cannot install it on my Mac because of an error:

iMac-van-Hans-van-Eijsden: hans$ npm -g install minidsp
/usr/local/bin/minidsp -> /usr/local/lib/node_modules/minidsp/minidsp.js

> get-cursor-position@1.0.3 install /usr/local/lib/node_modules/minidsp/node_modules/get-cursor-position
> node-gyp rebuild

  CXX(target) Release/obj.target/pos/src/pos.o
  SOLINK_MODULE(target) Release/pos.node

> node-hid@0.5.7 install /usr/local/lib/node_modules/minidsp/node_modules/node-hid
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.5.0 runtime=node arch=x64 platform=darwin)
  CC(target) Release/obj.target/hidapi/hidapi/mac/hid.o
../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:207:45: error: no matching member function for call to 'NewInstance'
    Local<Object> buf = nodeBufConstructor->NewInstance(1, nodeBufferArgs);
                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/hans/.node-gyp/10.5.0/include/node/v8.h:3914:44: note: candidate function not viable: requires single argument 'context', but 2 arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/hans/.node-gyp/10.5.0/include/node/v8.h:3911: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:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../../nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/HID.cc:409:37: warning: 'Value' is deprecated [-Wdeprecated-declarations]
        serialPointer = (wchar_t*) *v8::String::Value(info[2]);
                                    ^
/Users/hans/.node-gyp/10.5.0/include/node/v8.h:2876:5: note: 'Value' has been explicitly marked deprecated here
    V8_DEPRECATED("Use Isolate version", explicit Value(Local<v8::Value> obj));
    ^
/Users/hans/.node-gyp/10.5.0/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
2 warnings and 1 error 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/Cellar/node/10.5.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/minidsp/node_modules/node-hid
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
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/hans/.npm/_logs/2018-06-24T13_46_59_492Z-debug.log

System info:

$ node -v
v10.5.0
$ uname -a
Darwin iMac-van-Hans-van-Eijsden.local 17.6.0 Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64

Debug output (/Users/hans/.npm/_logs/2018-06-24T13_46_59_492Z-debug.log):
debug.txt

Am I doing something wrong? Thanks!

@mrene mrene self-assigned this Jun 25, 2018
@mrene mrene closed this as completed in 8bc2df0 Jun 25, 2018
@mrene mrene reopened this Jun 25, 2018
@mrene
Copy link
Owner

mrene commented Jun 25, 2018

Thanks for reporting this - I published 1.0.4 with an upgraded node-hid which fixes the problem you're having with node 10.5. Give it another try!

@HansVanEijsden
Copy link
Author

Thank you very much @mrene for the really quick solution. Great!
The error is gone and the program installs successfully.

There's another issue but unrelated to this ticket (I think because I use the DDRC-24), I will open it in another ticket.

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

No branches or pull requests

2 participants