Unable to install node-red-contrib-usbhid

HI, i'm new to this and having some annoying node install issues using Palette Manager. I've appended to an existing ticket...
I have tried this on different /fresh builds and the issues are repeatable (for me!)

  • I have a fresh Raspberry pi OS recommended build (32 bit) on a pi4 (64 bit)
    I installed node + npm + node-red using the single line bash 'script' on the node-red site
    Using the Palette manager i successfully added mpd node
    I then installed iohook - this states installed successfully - but i have an error when deploying
    Finally i get install fail on node 'usbhid' - it appears to be a permission fail when creating directories? I did successfully install the libusb + libudev dependencies prior
    I feel this is solvable - but beyond my skills
    This is a fresh OS, rpi as user, and only app added was screenshot to assist here. Any help appreciated.
    Thanks

And my failed node install

Please don't post screenshots of text output. Copy/paste the text here.

Go into your .node-red folder and run
npm install node-red-contrib-usbhid
and paste the full output here. When pasting it in use the </> button at the top of the forum entry window and paste it between the lines containing three backticks.

This node hasn't been updated in 4 years but looking the the nodes issues there is a thread that might help you. see:

This also may be a 32 vrs 64 bit instal issue.

Good luck!

section of log for failed node install - thanks - cut in half as too long!

npm ERR! code 1
npm ERR! path /home/rpi/.node-red/node_modules/node-hid
npm ERR! command failed
npm ERR! command sh -c -- prebuild-install || node-gyp rebuild
npm ERR! make: Entering directory '/home/rpi/.node-red/node_modules/node-hid/build'
npm ERR!   CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o
npm ERR!   AR(target) Release/obj.target/hidapi.a
npm ERR!   COPY Release/hidapi.a
npm ERR!   CXX(target) Release/obj.target/HID/src/HID.o
npm ERR! make: Leaving directory '/home/rpi/.node-red/node_modules/node-hid/build'
npm ERR! sh: 1: prebuild-install: Permission denied
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@16.20.1 | linux | arm
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/rpi/.node-red/node_modules/node-hid/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/rpi/.cache/node-gyp/16.20.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/rpi/.cache/node-gyp/16.20.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/rpi/.cache/node-gyp/16.20.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/rpi/.node-red/node_modules/node-hid',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../hidapi/libusb/hid.c: In function ‘hid_read_timeout’:
npm ERR! ../hidapi/libusb/hid.c:1078:6: warning: variable ‘bytes_read’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
npm ERR!  1078 |  int bytes_read = -1;
npm ERR!       |      ^~~~~~~~~~
npm ERR! ../src/HID.cc:67:5: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
npm ERR!    67 |     throw(JSException);
npm ERR!       |     ^~~~~
npm ERR! ../src/HID.cc:70:5: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
npm ERR!    70 |     throw(JSException);
npm ERR!       |     ^~~~~
npm ERR! ../src/HID.cc:152:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
npm ERR!   152 |   throw(JSException)
npm ERR!       |   ^~~~~
npm ERR! ../src/HID.cc:163:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
npm ERR!   163 |   throw(JSException)
npm ERR!       |   ^~~~~
npm ERR! ../src/HID.cc: In member function ‘void HID::readResultsToJSCallbackArguments(HID::ReceiveIOCB*, v8::Local<v8::Value>*)’:
npm ERR! ../src/HID.cc:203:91: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>)’
npm ERR!   203 |       Nan::GetCurrentContext()->Global()->Get(Nan::New<String>("Buffer").ToLocalChecked() )
npm ERR!       |                                                                                           ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
npm ERR!  4007 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
npm ERR!  4010 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/HID.cc:207:74: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [1])’
npm ERR!   207 |     Local<Object> buf = nodeBufConstructor->NewInstance(1, nodeBufferArgs);
npm ERR!       |                                                                          ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4759:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const’
npm ERR!  4759 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
npm ERR!       |                                            ^~~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4759:44: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4762:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’
npm ERR!  4762 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
npm ERR!       |                                            ^~~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4762:44: note:   candidate expects 1 argument, 2 provided
npm ERR! ../src/HID.cc: In static member function ‘static void HID::recvAsyncDone(uv_work_t*)’:
npm ERR! ../src/HID.cc:231:32: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]
npm ERR!   231 |   iocb->_callback->Call(2, argv);
npm ERR!       |                                ^
npm ERR! In file included from ../src/HID.cc:31:
npm ERR! ../../nan/nan.h:1746:3: note: declared here
npm ERR!  1746 |   Call(int argc, v8::Local<v8::Value> argv[]) const {
npm ERR!       |   ^~~~
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::read(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:257:52: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm ERR!   257 |   uv_queue_work(uv_default_loop(), req, recvAsync, (uv_after_work_cb)recvAsyncDone);
npm ERR!       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::readSync(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:280:51: error: no matching function for call to ‘v8::Array::Set(int&, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   280 |     retval->Set(i, Nan::New<Integer>(buff_read[i]));
npm ERR!       |                                                   ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::readTimeout(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:305:51: error: no matching function for call to ‘v8::Array::Set(int&, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   305 |     retval->Set(i, Nan::New<Integer>(buff_read[i]));
npm ERR!       |                                                   ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::getFeatureReport(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:339:45: error: no matching function for call to ‘v8::Array::Set(int&, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   339 |     retval->Set(i, Nan::New<Integer>(buf[i]));
npm ERR!       |                                             ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::sendFeatureReport(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:360:29: error: no matching function for call to ‘v8::Array::Get(unsigned int&)’
npm ERR!   360 |     if (!messageArray->Get(i)->IsNumber()) {
npm ERR!       |                             ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
npm ERR!  4007 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
npm ERR!  4010 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/HID.cc:363:58: error: no matching function for call to ‘v8::Array::Get(unsigned int&)’
npm ERR!   363 |     message.push_back((unsigned char) messageArray->Get(i)->Int32Value());
npm ERR!       |                                                          ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
npm ERR!  4007 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
npm ERR!  4010 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::New(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:404:46: error: no matching function for call to ‘v8::Value::Int32Value()’
npm ERR!   404 |       int32_t vendorId = info[0]->Int32Value();
npm ERR!       |                                              ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
npm ERR!  3107 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
npm ERR!       |                                        ^~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note:   candidate expects 1 argument, 0 provided
npm ERR! ../src/HID.cc:405:47: error: no matching function for call to ‘v8::Value::Int32Value()’
npm ERR!   405 |       int32_t productId = info[1]->Int32Value();
npm ERR!       |                                               ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
npm ERR!  3107 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
npm ERR!       |                                        ^~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note:   candidate expects 1 argument, 0 provided
npm ERR! ../src/HID.cc:409:62: error: no matching function for call to ‘v8::String::Value::Value(v8::Local<v8::Value>)’
npm ERR!   409 |         serialPointer = (wchar_t*) *v8::String::Value(info[2]);
npm ERR!       |                                                              ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3604:5: note: candidate: ‘v8::String::Value::Value(v8::Isolate*, v8::Local<v8::Value>)’
npm ERR!  3604 |     Value(Isolate* isolate, Local<v8::Value> obj);
npm ERR!       |     ^~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3604:5: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::setNonBlocking(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:443:37: error: no matching function for call to ‘v8::Value::Int32Value()’
npm ERR!   443 |   blockStatus = info[0]->Int32Value();
npm ERR!       |                                     ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
npm ERR!  3107 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
npm ERR!       |                                        ^~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note:   candidate expects 1 argument, 0 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::write(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:468:31: error: no matching function for call to ‘v8::Array::Get(unsigned int&)’
npm ERR!   468 |       if (!messageArray->Get(i)->IsNumber()) {
npm ERR!       |                               ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
npm ERR!  4007 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
npm ERR!  4010 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/HID.cc:471:60: error: no matching function for call to ‘v8::Array::Get(unsigned int&)’
npm ERR!   471 |       message.push_back((unsigned char) messageArray->Get(i)->Int32Value());
npm ERR!       |                                                            ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
npm ERR!  4007 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
npm ERR!  4010 |   V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!       |                                           ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::getDeviceInfo(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:505:62: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
npm ERR!   505 |       Nan::New<String>(narrow(wstr).c_str()).ToLocalChecked());
npm ERR!       |                                                              ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:509:62: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
npm ERR!   509 |       Nan::New<String>(narrow(wstr).c_str()).ToLocalChecked());
npm ERR!       |                                                              ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:513:62: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
npm ERR!   513 |       Nan::New<String>(narrow(wstr).c_str()).ToLocalChecked());
npm ERR!       |                                                              ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::devices(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/HID.cc:535:38: error: no matching function for call to ‘v8::Value::Int32Value()’
npm ERR!   535 |       vendorId = info[0]->Int32Value();
npm ERR!       |                                      ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
npm ERR!  3107 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
npm ERR!       |                                        ^~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note:   candidate expects 1 argument, 0 provided
npm ERR! ../src/HID.cc:536:39: error: no matching function for call to ‘v8::Value::Int32Value()’
npm ERR!   536 |       productId = info[1]->Int32Value();
npm ERR!       |                                       ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
npm ERR!  3107 |   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
npm ERR!       |                                        ^~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3107:40: note:   candidate expects 1 argument, 0 provided
npm ERR! ../src/HID.cc:551:101: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   551 |     deviceInfo->Set(Nan::New<String>("vendorId").ToLocalChecked(), Nan::New<Integer>(dev->vendor_id));
npm ERR!       |                                                                                                     ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:552:103: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   552 |     deviceInfo->Set(Nan::New<String>("productId").ToLocalChecked(), Nan::New<Integer>(dev->product_id));
npm ERR!       |                                                                                                       ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:554:110: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
npm ERR!   554 |       deviceInfo->Set(Nan::New<String>("path").ToLocalChecked(), Nan::New<String>(dev->path).ToLocalChecked());
npm ERR!       |                                                                                                              ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     

Part II

npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:563:139: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>)’
npm ERR!   563 |       deviceInfo->Set(Nan::New<String>("product").ToLocalChecked(), Nan::New<String>(narrow(dev->product_string).c_str()).ToLocalChecked());
npm ERR!       |                                                                                                                                           ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:565:105: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   565 |     deviceInfo->Set(Nan::New<String>("release").ToLocalChecked(), Nan::New<Integer>(dev->release_number));
npm ERR!       |                                                                                                         ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:566:109: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   566 |     deviceInfo->Set(Nan::New<String>("interface").ToLocalChecked(), Nan::New<Integer>(dev->interface_number));
npm ERR!       |                                                                                                             ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:568:107: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   568 |         deviceInfo->Set(Nan::New<String>("usagePage").ToLocalChecked(), Nan::New<Integer>(dev->usage_page));
npm ERR!       |                                                                                                           ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:571:98: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)’
npm ERR!   571 |         deviceInfo->Set(Nan::New<String>("usage").ToLocalChecked(), Nan::New<Integer>(dev->usage));
npm ERR!       |                                                                                                  ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc:573:36: error: no matching function for call to ‘v8::Array::Set(int, v8::Local<v8::Object>&)’
npm ERR!   573 |     retval->Set(count++, deviceInfo);
npm ERR!       |                                    ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/HID.cc: In static member function ‘static void HID::Initialize(v8::Local<v8::Object>)’:
npm ERR! ../src/HID.cc:596:16: error: cannot convert ‘void (*)(void*)’ to ‘node::Environment*’
npm ERR!   596 |   node::AtExit(deinitialize, 0);
npm ERR!       |                ^~~~~~~~~~~~
npm ERR!       |                |
npm ERR!       |                void (*)(void*)
npm ERR! In file included from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:979:38: note:   initializing argument 1 of ‘void node::AtExit(node::Environment*, void (*)(void*), void*)’
npm ERR!   979 | NODE_EXTERN void AtExit(Environment* env,
npm ERR!       |                         ~~~~~~~~~~~~~^~~
npm ERR! ../src/HID.cc:614:82: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
npm ERR!   614 |   target->Set(Nan::New<String>("HID").ToLocalChecked(), hidTemplate->GetFunction());
npm ERR!       |                                                                                  ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:6802:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
npm ERR!  6802 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
npm ERR!       |                                              ^~~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:6802:46: note:   candidate expects 1 argument, 0 provided
npm ERR! ../src/HID.cc:616:115: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
npm ERR!   616 |   target->Set(Nan::New<String>("devices").ToLocalChecked(), Nan::New<FunctionTemplate>(HID::devices)->GetFunction());
npm ERR!       |                                                                                                                   ^
npm ERR! In file included from /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:73,
npm ERR!                  from ../src/HID.cc:30:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:6802:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
npm ERR!  6802 |   V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
npm ERR!       |                                              ^~~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/v8.h:6802:46: note:   candidate expects 1 argument, 0 provided
npm ERR! In file included from ../src/HID.cc:30:
npm ERR! ../src/HID.cc: At global scope:
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:887:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!   887 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/rpi/.cache/node-gyp/16.20.1/include/node/node.h:921:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!   921 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/HID.cc:629:3: note: in expansion of macro ‘NODE_MODULE’
npm ERR!   629 |   NODE_MODULE(HID, init);
npm ERR!       |   ^~~~~~~~~~~
npm ERR! make: *** [HID.target.mk:122: Release/obj.target/HID/src/HID.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 6.1.21-v8+
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/rpi/.node-red/node_modules/node-hid
npm ERR! gyp ERR! node -v v16.20.1
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rpi/.npm/_logs/2023-06-28T05_50_03_145Z-debug-0.log

Thanks I might re-try on a pi3 and possibly an older node version? Appreciated your response :slight_smile:

Did you see this :point_up: near the very top?

How did you install Node-RED - did you use the official installer script? I suspect at some point you have used sudo and now have mixed permissions!

Lastly, did you follow @zenofmud post? The last post in that thread says:

The following worked for me:

  • sudo apt install libudev-dev
  • sudo apt install libudev-1.0-0-dev
  • cd .node-red/
  • npm install somebuddy87/node-red-contrib-usbhid
  • sudo systemctl restart nodered

@melbnz - As this is a different problem, the discussion has been moved here - to it's own topic thread.

We have 2 discussions here. The attached text log was from the npm install per Colins request.
I did try the somebuddy87 variant and that failed - but I have not posted log. I will do that when back on that machine.
I do not believe I’ve used sudo for anything. This should be replicable if you download the raspberry pi os, install node, red + npm with script, then add nodes (if anyone has time of inclination :wink:). On RPi 4. Node-red/npm are trying to install under my user, and the issue is not creating? Both my .node-red, lib and node_modules folders belong to user rpi.
My other problem child (node) iohook-napi and node-red- contrib are in the modules folder, with issue shown near top of this thread. Along with default & pi modules.

libudev-1.0.0-dev is not in the repository there is a gu variant (GObject)but i'm unsure of any options and dont want to add too much rubbish unless someone can guide me.

That is the wrong package. Look again at the prerequisites on the node's web page.

As mentioned in my opening description I did successfully install the stated dependencies related to the node. My comment above related to the alternative dependency suggested as ‘works’.

The package name you posted is not the same as the in in the suggested as 'works'. Admittedly that one is also wrong.
The suggested package was libudev-1.0-0-dev, which doesn't exist.
You mis-copied it as libudev-1.0.0-dev which also doesn't exist.
The correct package is libusb-1.0-0-dev which does exist.

All of which shows the importance of using copy/paste in such circumstances, not re-typing.

Have you managed to install it? If not then you don't seem to have answered the question as to whether you have tried installing the forked package as in the thread mentioned.
npm install somebuddy87/node-red-contrib-usbhid

Thanks Colin, I had installed libusb-1.0-0-dev already as that was the proposed prerequisites for the node. And no it didn’t install, either somebuddy version or original using npm. I’ve decided to have a crack at my requirement using python instead as the support is more up to date.
Thanks for all your suggestions

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.