Can't install bluethoot module on a Raspberry PI 3

Hi,

For my work i have to do some IoT with the Raspberry PI 3 and the Estimote Beacon (the yellow one).

I want to test with your sample https://github.com/estimote/estimote-specs but after cloning it and do npm install i always have some errors to install the Bluethoot module …

Here are the errors:

gyp ERR! stack Error: Can’t find Python executable “C:ProgramsPython2.7python2.7.exe”, you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Linux 4.14.98-v7+

Thank you very much for your time :slight_smile:

It looks like you need Python—do you have it installed? If you do, try setting the PYTHON env variable like the error says.

Also, here’s a related Stack Overflow thread, maybe it’ll help:

https://stackoverflow.com/questions/15126050/running-python-on-windows-for-node-js-dependencies

I don’t have a Windows machine at hand, and my RPi runs Linux, so forgive the somewhat-vague reply (:

Thanks for your response (:

Yes i have installed it on the Raspberry PI 3 (Raspbian)

When i write
ls /usr/bin/python i’ve got this:
image

The command line “which python” gives me “/usr/bin/python”

And i also tried to put these lines

export PYTHONPATH=$PYTHONPATH:/usr/bin
export PATH=$PATH:/usr/local/bin

in my ~/.bashrc .

But nothing change :frowning:
Maybe it’s because gyp is looking for Windows pyhton executable ('C:programsPython2.7 …) while i’m on Raspbian

What if you try this:

export PYTHON=/usr/bin/python

Note the error message says:

Can’t find Python executable “C:ProgramsPython2.7python2.7.exe”, you can set the PYTHON env variable.

Pretty weird all in all, /usr/bin/python is as common as it gets, so why gyp thinks you’re on Windows and looks under C:\Programs\... is beyond me :slight_smile:

Ok i don’t know if it’s because i set the Python env variable (i try loads of solution including install globally, changing the version of node …) but now i have a different error message …

image

bluetooth-hci-socket cause me a lot of problems :smile:

Looks like some problem with your installation. Did you install all the necessary pre-requisites?

https://github.com/noble/noble#ubuntudebianraspbian

Maybe try deleting node_modules, and running npm install again? :stuck_out_tongue:

If all of this fails, there’s a fair bit of similar reports on the noble issue tracker, maybe you’ll find some solution that’ll work for you there:

Google: cannot find module ‘…/build/release/binding.node’ site:github.com/noble

The solution was to install a npm manager version. So i installed ‘n’ (npm manager node version package) and downgrade to a lower version (6.6.6 if i remember well).

Now everything works ! :smiley:

1 Like

Hi Nicolas

Node 8.5.1 works as well:
nvm install 8.15.1
nvm use 8.15.1

It would be nice if Node 10 could come to work - or at least the reference project would tell that you need an older Node version to get things working.