I'm trying to install a npm usb package on a raspberry pi. It's needed by a library (in turn used by a node for node-red) but trying to install that seperately didn't work, so I'm installing this dependency first, by doing the following in the desired directory:
sudo npm install usb
It seems to run fine though I do get the following stacktrace:
> firstname.lastname@example.org install /home/pi/Documents/Nodes/mynode/node_modules/usb > node-pre-gyp install --fallback-to-build node-pre-gyp ERR! Tried to download: https://github.com/tessel/node-usb/releases/download/1.2.0/usb_bindings-v1.2.0-node-v48-linux-arm.tar.gz node-pre-gyp ERR! Pre-built binaries not found for email@example.com and firstname.lastname@example.org (node-v48 ABI) (falling back to source compile with node-gyp) gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.11.2" gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/Documents/Nodes/ant_plus_node/node_modules/usb/.node-gyp" make ✖ ERR Missing Makefile / Bakefile make ℹ info Run "make init" to generate a Makefile. email@example.com /home/pi/Documents/Nodes/ant_plus_node └─┬ firstname.lastname@example.org └── email@example.com
Missing Makfile / Bakefile seemed especially weird to me. When I attempt to use the node in node-red I get the following message:
"Error: /home/pi/Documents/Nodes/ant_plus_node/node_modules/usb/src/binding/usb_bindings.node: cannot open shared object file: No such file or directory"
And yes, when I go to the directory it's not there. So I tried going to the the usb module and running
make init and running the install again. But still no
usb_bindings.node to be found.
Can anyone point me to a possible direction where this might be going wrong? Perhaps something with
node-pre-gyp? I don't need an "as-is" answer perse.
As a sidenote, when I'm in the package I'm trying to link using 'npm link', which uses a library I partially wrote which has 'usb' as a dependency, I get the exact same stacktrace.
nodejs version 6.11.12
npm version 3.10.10
And in case relevant (I've seen them being mentioned in the
python version 2.7.9
python3 version 3.4.2