question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'bluetooth-hci-socket'

See original GitHub issue

I am trying to make bleno work with a raspberry pi 3 and I am getting this error: internal/modules/cjs/loader.js:583 throw err; ^

Error: Cannot find module ‘bluetooth-hci-socket’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (/home/pi/Desktop/hwTest/node_modules/bleno/lib/hci-socket/mgmt.js:6:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3)

I had the same issue on windows but I manged to slove that by installing the package however here when I am trying to install the missing module I am getting this error: npm i bluetooth-hci-socket npm WARN npm npm does not support Node.js v10.15.2 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can’t make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/

usb@1.6.0 install /home/pi/Desktop/code/ent_gate/node_modules/usb prebuild-install --verbose || node-gyp rebuild

prebuild-install info begin Prebuild-install version 5.3.0 prebuild-install info looking for cached prebuild @ /home/pi/.npm/_prebuilds/2643fa-usb-v1.6.0-node-v64-linux-arm.tar.gz prebuild-install http request GET https://github.com/tessel/node-usb/releases/download/v1.6.0/usb-v1.6.0-node-v64-linux-arm.tar.gz prebuild-install http 404 https://github.com/tessel/node-usb/releases/download/v1.6.0/usb-v1.6.0-node-v64-linux-arm.tar.gz prebuild-install WARN install No prebuilt binaries found (target=10.15.2 runtime=node arch=arm libc= platform=linux) make: Entering directory ‘/home/pi/Desktop/code/ent_gate/node_modules/usb/build’ CC(target) Release/obj.target/libusb/libusb/libusb/core.o CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o CC(target) Release/obj.target/libusb/libusb/libusb/io.o CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o CC(target) Release/obj.target/libusb/libusb/libusb/sync.o CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o AR(target) Release/obj.target/usb.a COPY Release/usb.a CXX(target) Release/obj.target/usb_bindings/src/node_usb.o In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/node_usb.cc:1: …/node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’: …/node_modules/nan/nan.h:2232:62: 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] , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete) ^ In file included from …/src/node_usb.h:14, from …/src/node_usb.cc:1: …/src/node_usb.cc: At global scope: /usr/include/nodejs/src/node.h:570:43: warning: cast between incompatible function types from ‘void ()(v8::Localv8::Object)’ to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void*)’} [-Wcast-function-type] (node::addon_register_func) (regfunc),
^ /usr/include/nodejs/src/node.h:604:3: note: in expansion of macro ‘NODE_MODULE_X’ NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) ^~~~~~~~~~~~~ …/src/node_usb.cc:95:1: note: in expansion of macro ‘NODE_MODULE’ NODE_MODULE(usb_bindings, Initialize) ^~~~~~~~~~~ …/src/node_usb.cc: In function ‘void handleHotplug(std::pair<libusb_device*, libusb_hotplug_event>)’: …/src/node_usb.cc:151:58: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char*, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(Nan::New(hotplugThis), “emit”, 2, argv); ^ In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/node_usb.cc:1: …/node_modules/nan/nan.h:1001:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/node_usb.cc:151:58: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(Nan::New(hotplugThis), “emit”, 2, argv); ^ In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/node_usb.cc:1: …/node_modules/nan/nan.h:1001:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ In file included from …/src/node_usb.h:12, from …/src/node_usb.cc:1: /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]’: /usr/include/nodejs/src/node_object_wrap.h:85:78: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] reinterpret_cast<Callback>(callback), type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’: …/node_modules/nan/nan_object_wrap.h:65:61: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] CXX(target) Release/obj.target/usb_bindings/src/device.o In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/device.cc:1: …/node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker)’: …/node_modules/nan/nan.h:2232:62: 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] , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete) ^ …/src/device.cc: In member function ‘void Req::submit(Device*, v8::Localv8::Function, uv_work_cb, uv_work_cb)’: …/src/device.cc:220:70: warning: cast between incompatible function types from ‘uv_work_cb’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type] uv_queue_work(uv_default_loop(), &req, backend, (uv_after_work_cb) after); ^~~~~ …/src/device.cc: In static member function ‘static void Req::default_after(uv_work_t*)’: …/src/device.cc:237:64: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv); ^ In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/device.cc:1: …/node_modules/nan/nan.h:959:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/device.cc:237:64: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(device, Nan::New(baton->callback), 1, argv); ^ In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/device.cc:1: …/node_modules/nan/nan.h:959:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ In file included from …/src/node_usb.h:12, from …/src/device.cc:1: /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]’: /usr/include/nodejs/src/node_object_wrap.h:85:78: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] reinterpret_cast<Callback>(callback), type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’: …/node_modules/nan/nan_object_wrap.h:65:61: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] CXX(target) Release/obj.target/usb_bindings/src/transfer.o In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/transfer.cc:1: …/node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker)’: …/node_modules/nan/nan.h:2232:62: 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] , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete) ^ …/src/transfer.cc: In function ‘void handleCompletion(Transfer*)’: …/src/transfer.cc:126:72: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv); ^ In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/transfer.cc:1: …/node_modules/nan/nan.h:959:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/transfer.cc:126:72: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(self->handle(), Nan::New(self->v8callback), 3, argv); ^ In file included from …/src/helpers.h:3, from …/src/node_usb.h:21, from …/src/transfer.cc:1: …/node_modules/nan/nan.h:959:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ In file included from …/src/node_usb.h:12, from …/src/transfer.cc:1: /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]’: /usr/include/nodejs/src/node_object_wrap.h:85:78: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] reinterpret_cast<Callback>(callback), type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’: …/node_modules/nan/nan_object_wrap.h:65:61: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] SOLINK_MODULE(target) Release/obj.target/usb_bindings.node COPY Release/usb_bindings.node make: Leaving directory ‘/home/pi/Desktop/code/ent_gate/node_modules/usb/build’

bluetooth-hci-socket@0.5.1 install /home/pi/Desktop/code/ent_gate/node_modules/bluetooth-hci-socket node-gyp rebuild

make: Entering directory ‘/home/pi/Desktop/code/ent_gate/node_modules/bluetooth-hci-socket/build’ CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o In file included from …/src/BluetoothHciSocket.cpp:8: …/…/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’: …/…/nan/nan.h:2298:62: 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] , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete) ^ …/src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’: …/src/BluetoothHciSocket.cpp:251:95: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New(“emit”).ToLocalChecked(), 2, argv); ^ In file included from …/src/BluetoothHciSocket.cpp:8: …/…/nan/nan.h:1045:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/BluetoothHciSocket.cpp:251:95: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New(“emit”).ToLocalChecked(), 2, argv); ^ In file included from …/src/BluetoothHciSocket.cpp:8: …/…/nan/nan.h:1045:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’: …/src/BluetoothHciSocket.cpp:275:72: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Localv8::Value [1])’ Local<Value> error = errorConstructor->NewInstance(1, constructorArgs); ^ In file included from /usr/include/nodejs/src/node.h:63, from /usr/include/nodejs/src/node_buffer.h:25, from …/src/BluetoothHciSocket.cpp:7: /usr/include/nodejs/deps/v8/include/v8.h:3993:44: note: candidate: ‘v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context, int, v8::Localv8::Value) const’ V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( ^~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8.h:3993:44: note: candidate expects 3 arguments, 2 provided /usr/include/nodejs/deps/v8/include/v8.h:3996:44: note: candidate: ‘v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context) const’ V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( ^~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8.h:3996:44: note: candidate expects 1 argument, 2 provided …/src/BluetoothHciSocket.cpp:282:93: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New(“emit”).ToLocalChecked(), 2, argv); ^ In file included from …/src/BluetoothHciSocket.cpp:8: …/…/nan/nan.h:1045:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/BluetoothHciSocket.cpp:282:93: warning: ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value)’ is deprecated [-Wdeprecated-declarations] Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New(“emit”).ToLocalChecked(), 2, argv); ^ In file included from …/src/BluetoothHciSocket.cpp:8: …/…/nan/nan.h:1045:46: note: declared here NAN_DEPRECATED inline v8::Localv8::Value MakeCallback( ^~~~~~~~~~~~ …/src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)’: …/src/BluetoothHciSocket.cpp:395:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated: Use maybe version [-Wdeprecated-declarations] devId = arg0->IntegerValue(); ^ In file included from /usr/include/nodejs/deps/v8/include/v8.h:26, from /usr/include/nodejs/src/node.h:63, from /usr/include/nodejs/src/node_buffer.h:25, from …/src/BluetoothHciSocket.cpp:7: /usr/include/nodejs/deps/v8/include/v8.h:2476:46: note: declared here V8_DEPRECATED(“Use maybe version”, int64_t IntegerValue() const); ^~~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’ declarator attribute((deprecated(message))) ^~~~~~~~~~ …/src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)’: …/src/BluetoothHciSocket.cpp:417:34: warning: ‘int64_t v8::Value::IntegerValue() const’ is deprecated: Use maybe version [-Wdeprecated-declarations] devId = arg0->IntegerValue(); ^ In file included from /usr/include/nodejs/deps/v8/include/v8.h:26, from /usr/include/nodejs/src/node.h:63, from /usr/include/nodejs/src/node_buffer.h:25, from …/src/BluetoothHciSocket.cpp:7: /usr/include/nodejs/deps/v8/include/v8.h:2476:46: note: declared here V8_DEPRECATED(“Use maybe version”, int64_t IntegerValue() const); ^~~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’ declarator attribute((deprecated(message))) ^~~~~~~~~~ In file included from /usr/include/nodejs/src/node_buffer.h:25, from …/src/BluetoothHciSocket.cpp:7: …/src/BluetoothHciSocket.cpp: At global scope: /usr/include/nodejs/src/node.h:570:43: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Localv8::Object)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void*)’} [-Wcast-function-type] (node::addon_register_func) (regfunc),
^ /usr/include/nodejs/src/node.h:604:3: note: in expansion of macro ‘NODE_MODULE_X’ NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) ^~~~~~~~~~~~~ …/src/BluetoothHciSocket.cpp:499:1: note: in expansion of macro ‘NODE_MODULE’ NODE_MODULE(binding, BluetoothHciSocket::Init); ^~~~~~~~~~~ In file included from /usr/include/nodejs/src/node.h:63, from /usr/include/nodejs/src/node_buffer.h:25, from …/src/BluetoothHciSocket.cpp:7: /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfonode::ObjectWrap&)]’: /usr/include/nodejs/src/node_object_wrap.h:85:78: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfonode::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfonode::ObjectWrap&)’} to ‘Callback’ {aka ‘void ()(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] reinterpret_cast<Callback>(callback), type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/nodejs/deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)]’: …/…/nan/nan_object_wrap.h:65:61: required from here /usr/include/nodejs/deps/v8/include/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfoNan::ObjectWrap::Callback’ {aka ‘void ()(const v8::WeakCallbackInfoNan::ObjectWrap&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] make: *** [binding.target.mk:101: Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1 make: Leaving directory ‘/home/pi/Desktop/code/ent_gate/node_modules/bluetooth-hci-socket/build’ gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.19.69-v7+ gyp ERR! command “/usr/bin/node” “/usr/bin/node-gyp” “rebuild” gyp ERR! cwd /home/pi/Desktop/code/ent_gate/node_modules/bluetooth-hci-socket gyp ERR! node -v v10.15.2 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN gate@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@0.1.4 (node_modules/xpc-connection): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for xpc-connection@0.1.4: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bluetooth-hci-socket@0.5.1 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bluetooth-hci-socket@0.5.1 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! /home/pi/.npm/_logs/2019-09-02T16_14_06_552Z-debug.log

Any suggestions?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

10reactions
deepakvalagamcommented, Mar 12, 2020

Install node version manager:

sudo npm install -g n

Downgrade node to v 8.9.0 by:

sudo n 8.9.0

then

sudo npm install bluetooth-hci-socket --unsafe-perm

3reactions
nkemcelscommented, Nov 12, 2020

Or if downgrading nodejs is not an option for you as it was in my case, then use @abandonware/bleno instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module 'bluetooth-hci-socket' #15
When I try to run btlejuice-proxy I keep getting the same error: module.js:487 throw err; ^ Error: Cannot find module 'bluetooth-hci-socket' ...
Read more >
bluetooth-hci-socket
Bluetooth HCI socket binding for Node.js. ... Start using bluetooth-hci-socket in your project by running `npm i bluetooth-hci-socket`.
Read more >
to install npm bluetooth-hci-socket in project repository
all I'm going to develop a BLE Desktop app by using node, Electron Js as well as bleno. for this, we need "npm...
Read more >
bluetooth-hci-socket error : r/homebridge
[15/10/2021, 14:05:47] ERROR LOADING PLUGIN homebridge-eq3ble: [15/10/2021, 14:05:47] Error: Cannot find module 'bluetooth-hci-socket'.
Read more >
Can't enable newly installed node (node-red-contrib-noble)
[noble] Error: Cannot find module 'bluetooth-hci-socket'. Going to blow away the node_modules folder in /root/.node-red and trying to re-install the contrib ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found