Open hivenet-jakub opened 2 hours ago
Here is the error I'm getting after running npm install bluetooth-hci-socket --unsafe-perm
npm error code 1
npm error path /var/lib/homebridge/node_modules/bluetooth-hci-socket
npm error command failed
npm error command sh -c node-gyp rebuild
npm error make: Entering directory '/var/lib/homebridge/node_modules/bluetooth-hci-socket/build'
npm error CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
npm error make: Leaving directory '/var/lib/homebridge/node_modules/bluetooth-hci-socket/build'
npm error ../src/BluetoothHciSocket.cpp: In static member function ‘static void BluetoothHciSocket::Init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’:
npm error ../src/BluetoothHciSocket.cpp:128:81: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
npm error 128 | target->Set(Nan::New("BluetoothHciSocket").ToLocalChecked(), tmpl->GetFunction());
npm error | ~~~~~~~~~~~~~~~~~^~
npm error In file included from /home/pi/.cache/node-gyp/20.18.0/include/node/v8-function.h:15,
npm error from /home/pi/.cache/node-gyp/20.18.0/include/node/v8.h:33,
npm error from /home/pi/.cache/node-gyp/20.18.0/include/node/node.h:73,
npm error from /home/pi/.cache/node-gyp/20.18.0/include/node/node_buffer.h:25,
npm error from ../src/BluetoothHciSocket.cpp:7:
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-template.h:497:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’
npm error 497 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction(
npm error | ^~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-template.h:497:46: note: candidate expects 1 argument, 0 provided
npm error ../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’:
npm error ../src/BluetoothHciSocket.cpp:251:22: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated [-Wdeprecated-declarations]
npm error 251 | Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
npm error | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error In file included from ../src/BluetoothHciSocket.cpp:8:
npm error ../node_modules/nan/nan.h:1072:46: note: declared here
npm error 1072 | NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
npm error | ^~~~~~~~~~~~
npm error ../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’:
npm error ../src/BluetoothHciSocket.cpp:269:74: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>)’
npm error 269 | Local<Function> errorConstructor = Local<Function>::Cast(globalObj->Get(Nan::New("Error").ToLocalChecked()));
npm error | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error In file included from /home/pi/.cache/node-gyp/20.18.0/include/node/v8-array-buffer.h:13,
npm error from /home/pi/.cache/node-gyp/20.18.0/include/node/v8.h:24:
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-object.h:292:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’
npm error 292 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm error | ^~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-object.h:292:43: note: candidate expects 2 arguments, 1 provided
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-object.h:295:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’
npm error 295 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm error | ^~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-object.h:295:43: note: candidate expects 2 arguments, 1 provided
npm error ../src/BluetoothHciSocket.cpp:275:53: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [1])’
npm error 275 | Local<Value> error = errorConstructor->NewInstance(1, constructorArgs);
npm error | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-function.h:38:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const’
npm error 38 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
npm error | ^~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-function.h:38:44: note: candidate expects 3 arguments, 2 provided
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-function.h:41:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’
npm error 41 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
npm error | ^~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-function.h:41:44: note: candidate expects 1 argument, 2 provided
npm error ../src/BluetoothHciSocket.cpp:282:20: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated [-Wdeprecated-declarations]
npm error 282 | Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv);
npm error | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../node_modules/nan/nan.h:1072:46: note: declared here
npm error 1072 | NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
npm error | ^~~~~~~~~~~~
npm error ../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/BluetoothHciSocket.cpp:395:33: error: no matching function for call to ‘v8::Value::IntegerValue()’
npm error 395 | devId = arg0->IntegerValue();
npm error | ~~~~~~~~~~~~~~~~~~^~
npm error In file included from /home/pi/.cache/node-gyp/20.18.0/include/node/v8-primitive.h:11,
npm error from /home/pi/.cache/node-gyp/20.18.0/include/node/v8-object.h:11:
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-value.h:423:40: note: candidate: ‘v8::Maybe<long long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const’
npm error 423 | V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
npm error | ^~~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-value.h:423:40: note: candidate expects 1 argument, 0 provided
npm error ../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/BluetoothHciSocket.cpp:417:33: error: no matching function for call to ‘v8::Value::IntegerValue()’
npm error 417 | devId = arg0->IntegerValue();
npm error | ~~~~~~~~~~~~~~~~~~^~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-value.h:423:40: note: candidate: ‘v8::Maybe<long long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const’
npm error 423 | V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
npm error | ^~~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/v8-value.h:423:40: note: candidate expects 1 argument, 0 provided
npm error ../src/BluetoothHciSocket.cpp: At global scope:
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/node.h:1232:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘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 error 1232 | (node::addon_register_func) (regfunc), \
npm error | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /home/pi/.cache/node-gyp/20.18.0/include/node/node.h:1266:3: note: in expansion of macro ‘NODE_MODULE_X’
npm error 1266 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
npm error | ^~~~~~~~~~~~~
npm error ../src/BluetoothHciSocket.cpp:499:1: note: in expansion of macro ‘NODE_MODULE’
npm error 499 | NODE_MODULE(binding, BluetoothHciSocket::Init);
npm error | ^~~~~~~~~~~
npm error make: *** [binding.target.mk:106: Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/opt/homebridge/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Linux 6.6.28+rpt-rpi-v6
npm error gyp ERR! command "/opt/homebridge/bin/node" "/opt/homebridge/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /var/lib/homebridge/node_modules/bluetooth-hci-socket
npm error gyp ERR! node -v v20.18.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok
Expected Behavior
Plugin initialized
Current Behavior
Plugin fails to initialize - see log below. I installed it the following way:
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
sudo setcap cap_net_raw+eip $(eval readlink -f
which node)
npm install bluetooth-hci-socket --unsafe-perm
but I'm getting a long error logVersions
1.8.5
/opt/homebridge/lib └── (empty)
20.18.0
Homebridge Log / Command Output
I'm not very 'fluent' in all of this. Maybe it's something simple to fix? Any help would be super appreciated!