DigitalSecurity / btlejuice

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

Help me fix this issue :( Error: Cannot find module 'bluetooth-hci-socket' #49

Open jinggo900 opened 5 years ago

jinggo900 commented 5 years ago

root@anonymous:~/btlejuice# btlejuice-proxy 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:20:18) at Object. (/root/local/lib/node_modules/btlejuice/node_modules/noble/lib/hci-socket/hci.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) root@anonymous:~/btlejuice#

henrikschnor commented 5 years ago

The module doesn't seem to build properly with newer versions of nodejs, at least this was the issue for me. As a workaround I installed Node.js v8.x and installed btlejuice with the command sudo npm install --unsafe-perm -g btlejuice.

shoxxdj commented 5 years ago

If it helps, I had the same issue on archlinux, i've tried all the solutions in the different issues related to this bug and finaly solved with :

sudo  npm i -g @abandonware/bluetooth-hci-socket
cd /usr/lib/node_modules
sudo mv @abandonware/bluetooth-hci-socket .
sudo npm i -g btlejuice --unsafe-perm

The basic bluetooth-hci-socket is not maintained I guess ( last version from 2016 )

MoistZuko commented 4 years ago

The module doesn't seem to build properly with newer versions of nodejs, at least this was the issue for me. As a workaround I installed Node.js v8.x and installed btlejuice with the command sudo npm install --unsafe-perm -g btlejuice.

Using node.js v8.x and --unsafe-perm command works on my Ubuntu20.04.Thanks

R44wk commented 3 years ago

If it helps, I had the same issue on archlinux, i've tried all the solutions in the different issues related to this bug and finaly solved with :

sudo  npm i -g @abandonware/bluetooth-hci-socket
cd /usr/lib/node_modules
sudo mv @abandonware/bluetooth-hci-socket .
sudo npm i -g btlejuice --unsafe-perm

The basic bluetooth-hci-socket is not maintained I guess ( last version from 2016 )

Thanks, the solution worked for me on Kali

jsmif commented 3 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, exactly as shown by OP, 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.)