Cannot install bleno with nodejs 10.x in a raspberry pi zero. V8_DEPRECATED error
See original GitHub issueHi,
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:
- Created 5 years ago
- Reactions:5
- Comments:6
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 therequire('bluetooth-hci-socket')
torequire('@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
I followed @arthare advices, I’m running it with NodeJs
15.5.0
like a charm, thank you.