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 install bleno with nodejs 10.x in a raspberry pi zero. V8_DEPRECATED error

See original GitHub issue

Hi,

I’m trying to install the bleno module for node 10.15.0 using either a package.json file or just by running the npm install bleno I’m getting the following error:

 binding.target.mk:99: recipe for target 'Release/obj.target/binding/src/BluetoothHciSocket.o' failed
make: *** [Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1
make: Leaving directory '/home/pi/dev/nodejs/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 (/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.14.79+
gyp ERR! command "/opt/nodejs/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/dev/nodejs/node_modules/bluetooth-hci-socket
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN ble-server@1.0.0 No description
npm WARN ble-server@1.0.0 No repository field.
npm WARN ble-server@1.0.0 license should be a valid SPDX license expression
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: bluetooth-hci-socket@0.5.1 (node_modules/bluetooth-hci-socket):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bluetooth-hci-socket@0.5.1 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

It seems that it’s trying to use an old bluetooth-hci-socket version that using the deprercated V8 macro

While compiling it emmited this error:

../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::Local<v8::Value> [1])’
   Local<Value> error = errorConstructor->NewInstance(1, constructorArgs);

Any idea? Maybe the package.json should be changed in order to use the @abandonware/bluetooth-hci-socket module.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

2reactions
artharecommented, Aug 17, 2020

I can confirm changing the node-bluetooth-hci-socket dependency works. Change node-bluetooth-hci-socket to "@abandonware/bluetooth-hci-socket": "^0.5.3-5". And then update the require('bluetooth-hci-socket') to require('@abandonware/bluetooth-hci-socket')

Got it building and advertising on my raspi 4, after having the exact error posted in the OP. Have not tested extensively yet.

Changing dependency: https://github.com/arthare/bleno/commit/596acd9f32f889b8757f66bde23e25f488644259 Changing requires: https://github.com/arthare/bleno/commit/ae0034ab86a309f0dca7d77b1fed95e988d4e0bf

0reactions
Dizi0commented, Jan 7, 2021

I followed @arthare advices, I’m running it with NodeJs 15.5.0 like a charm, thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble updating to newer Node.js - Raspberry Pi Forums
And received the following error: ## Installing the NodeSource Node.js 0.10 repo… ## You appear to be running on ARMv6 hardware. Unfortunately ...
Read more >
Install NodeJS on a Raspberry Pi Zero - Hassan Corrigan
To install NodeJS, an ARMv6 build is required. However, NodeJS doesn't officially support the ARMv6 build required by the Pi Zero as of...
Read more >
Beginner's Guide to Installing Node.js on a Raspberry Pi
Download and install Balena Etcher. Balena Etcher is a cross-platform (Windows, OS X, Linux) tool for flashing images to SD cards. It has...
Read more >
noble - npm
A Node.js BLE (Bluetooth Low Energy) central module. Want to implement a peripheral? Checkout bleno. Note: macOS / Mac OS X, Linux, ...
Read more >
Run your Node.js application on a headless Raspberry Pi
SSH is not enabled by default in Raspbian, so you will have to do it before you boot the card for the first...
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