DigitalSecurity / btlejuice

BtleJuice Bluetooth Smart (LE) Man-in-the-Middle framework
739 stars 124 forks source link

error while installing bleno, hci-socket-error, #59

Open valerianwatson opened 4 years ago

valerianwatson commented 4 years ago

Hi everybody,

I am having an installation issue that is killing me. I want to install bleno on my raspberry pi 3b+ running raspbian buster. I used

npm install bleno

But I get the following error mnessages:

gyp WARN EACCES current user ("pi") does not have permission to access the dev dir "/root/.cache/node-gyp/12.16.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/bleproject/node_modules/bluetooth-hci-socket/.node-gyp"

...
../src/BluetoothHciSocket.cpp: In static member function ‘static void BluetoothHciSocket::Init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’:
../src/BluetoothHciSocket.cpp:128:82: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
   target->Set(Nan::New("BluetoothHciSocket").ToLocalChecked(), tmpl->GetFunction());

...
../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);

...
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:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.19.75-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/bleproject/node_modules/bluetooth-hci-socket
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/bleproject/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@~0.1.4 (node_modules/bleno/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 enoent ENOENT: no such file or directory, open '/home/pi/bleproject/package.json'
npm WARN bleproject No description
npm WARN bleproject No repository field.
npm WARN bleproject No README data
npm WARN bleproject No license field.
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

+ bleno@0.5.0
added 4 packages from 5 contributors and audited 107 packages in 59.06s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

I tried installing bleno with alll kinds of node versions (different versions v12.x, v13.x, v10.x, v8.x, v11.x with nvm), none seem to work. It also seems like it has something to do with bluetooth-hci-socket that apparently can't be found. I've tried installing it a bunch of time but I get similar errors, also this gyp ERR! stack Error: make failed with exit code: 2.

I'm grateful for any help!

caioluders commented 3 years ago

Same here looks like the npm package is broken

jsmif commented 6 months ago

FWIW I used the instructions from here: https://www.blackhillsinfosec.com/machine-in-the-middle-mitm-ble-attack/ to install npm 8.17.0 and bleno and noble and then I installed btlejuice with sudo npm install --unsafe-perm btlejuice and then I got errors about it not being able to find bluetooth-hci-socket so I installed that with sudo npm install -g --unsafe-perm bluetooth-hci-socket (if I didn't use the -g it continued to complain that it couldn't find it.)