abandonware / node-bluetooth-hci-socket

MIT License
43 stars 48 forks source link

Can't install on raspberry pi 3 #21

Closed mchirlin closed 3 years ago

mchirlin commented 3 years ago

When using npm install on Node 12 I get the following errors:

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/abandonware/node-bluetooth-hci-socket/releases/download/0.5.3-6/bluetooth_hci_socket-0.5.3-6-node-v72-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for @abandonware/bluetooth-hci-socket@0.5.3-6 and node@12.19.0 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/node_modules/@abandonware/bluetooth-hci-socket/build'
  CXX(target) Release/obj.target/bluetooth_hci_socket/src/BluetoothHciSocket.o
In file included from /root/.cache/node-gyp/12.19.0/include/node/uv/unix.h:31,
                 from /root/.cache/node-gyp/12.19.0/include/node/uv.h:66,
                 from ../../../nan/nan.h:55,
                 from ../src/BluetoothHciSocket.cpp:8:
/usr/include/netinet/in.h:18: error: unterminated #ifndef
   18 | #ifndef _NETINET_IN_H
      |
In file included from /usr/include/arpa/inet.h:22,
                 from /root/.cache/node-gyp/12.19.0/include/node/uv/unix.h:33,
                 from /root/.cache/node-gyp/12.19.0/include/node/uv.h:66,
                 from ../../../nan/nan.h:55,
                 from ../src/BluetoothHciSocket.cpp:8:
/usr/include/netinet/in.h:18: error: unterminated #ifndef
   18 | #ifndef _NETINET_IN_H
      |
In file included from /usr/include/netdb.h:27,
                 from /root/.cache/node-gyp/12.19.0/include/node/uv/unix.h:34,
                 from /root/.cache/node-gyp/12.19.0/include/node/uv.h:66,
                 from ../../../nan/nan.h:55,
                 from ../src/BluetoothHciSocket.cpp:8:
/usr/include/netinet/in.h:18: error: unterminated #ifndef
   18 | #ifndef _NETINET_IN_H
      |
^Cmake: *** [bluetooth_hci_socket.target.mk:109: Release/obj.target/bluetooth_hci_socket/src/BluetoothHciSocket.o] Interrupt

... lots more compilation errors

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.51-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node" "--module_name=bluetooth_hci_socket" "--module_path=/home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/pi/node_modules/@abandonware/bluetooth-hci-socket
gyp ERR! node -v v12.19.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node --module_name=bluetooth_hci_socket --module_path=/home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/pi/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 5.4.51-v7+
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/node_modules/@abandonware/bluetooth-hci-socket
node-pre-gyp ERR! node -v v12.19.0
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node --module_name=bluetooth_hci_socket --module_path=/home/pi/node_modules/@abandonware/bluetooth-hci-socket/lib/binding --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @abandonware/bluetooth-hci-socket@0.5.3-6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @abandonware/bluetooth-hci-socket@0.5.3-6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
mchirlin commented 3 years ago

Resolved this by reinstalling the home bridge raspian image. Looks like I had some corrupted c files.