0

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:

> usb@1.2.0 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 usb@1.2.0 and node@6.11.2 (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.
ant_plus_node@0.2.1 /home/pi/Documents/Nodes/ant_plus_node
└─┬ ant-plus@0.0.9
  └── usb@1.2.0

The 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.

I have:
nodejs version 6.11.12
npm version 3.10.10
And in case relevant (I've seen them being mentioned in the node-pre-gyp documentation):
python version 2.7.9
python3 version 3.4.2

  • Have you tried doing what the error message suggests doing make init? – Steve Robillard Aug 11 '17 at 17:49
  • I have actually, but the problem persists. I'll update the question however. – Joël Abrahams Aug 11 '17 at 18:11
  • What bothers me as well is that the stack trace is identicaly, even after doing make init. – Joël Abrahams Aug 11 '17 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.