question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install 1.7.* on Raspian (Debian for Raspberry Pi)

See original GitHub issue

Hello,

I use node-usb for a small project on my Raspberry Pi running Raspian. The 1.6 code worked great. With the advent of 1.7, I am seeing installation problems due to node-addon-api and node-gyp.

$ npm i usb@1.7.1 (node:17802) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

node-addon-api@3.0.2 install /home/pi/temp/node_modules/usb/node_modules/node-addon-api node-gyp rebuild

gyp: binding.gyp not found (cwd: /home/pi/temp/node_modules/usb/node_modules/node-addon-api) while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:304:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 4.19.66+ gyp ERR! command “/usr/bin/node” “/usr/bin/node-gyp” “rebuild” gyp ERR! cwd /home/pi/temp/node_modules/usb/node_modules/node-addon-api gyp ERR! node -v v8.11.1 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN This failure might be due to the use of legacy binary “node” npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

npm ERR! node-addon-api@3.0.2 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-addon-api@3.0.2 install script. npm ERR! This is most likely a problem with the node-addon-api package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls node-addon-api npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.19.66+ npm ERR! command “/usr/bin/node” “/usr/bin/npm” “i” “–save” “usb@1.7.1” npm ERR! cwd /home/pi/temp npm ERR! node -v v8.11.1 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/pi/temp/npm-debug.log npm ERR! not ok code 0

The same thing happens for a git clone and npm install. This happens for npm package installations of usb@1.7.0, usb@1.7.1, and usb@testing. usb@1.6.5 can still be installed via npm, and does install correctly.

I do a lot of the development on MacOS. npm i usb@1.7.1 works without issue there, but that appears to be because of a prebuilt binary:

prebuild-install --runtime napi --target 4 --verbose || node-gyp rebuild

prebuild-install info begin Prebuild-install version 5.3.6 prebuild-install info looking for cached prebuild @ /Users/chris/.npm/_prebuilds/a6bd0a-usb-v1.7.1-napi-v4-darwin-x64.tar.gz prebuild-install info found cached prebuild prebuild-install info unpacking @ /Users/chris/.npm/_prebuilds/a6bd0a-usb-v1.7.1-napi-v4-darwin-x64.tar.gz prebuild-install info unpack resolved to /Users/chris/hello/node_modules/usb/build/Release/usb_bindings.node prebuild-install info install Successfully installed prebuilt binary!

Why are we missing binding.gyp for the Raspberry Pi? What is the process to build node-usb?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
EpicVoyagecommented, Jun 3, 2021

After upgrading from Raspbian Stretch (9) to Raspbian Buster (10), I can install node v10 and use node-usb 1.7. Thanks for pointing me in the right direction!

$ cat /etc/debian_version 10.9

$ node -v v10.24.0

1reaction
EpicVoyagecommented, May 31, 2021

Okay, that makes sense. I am using an old Raspberry Pi (v1) with an armv6l processor no longer officially supported by node. Let me see what I can do about a software upgrade and I will report back.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Updating Java on Raspbian from 1.7.0 to 1.8.0
I just installed Raspbian which means it came pre-loaded with Java. ... I checked java -version and I have 1.7.0_40, the only way...
Read more >
RPi Imager 1.6.1 (and above) can't be installed on Ubuntu 18.04
My existing installation of RPi Imager 1.6 works fine. EDIT: The latest version that can run on Ubuntu 18.04 is RPi Imager 1.6....
Read more >
Unable to install systemd on debian 7
I am following the link [ packages.elastic.co/beats/apt stable main ] to install systemd on my raspberry pi b+. When I try the command...
Read more >
Raspberry Pi Imager 1.7 Released with New Advanced ...
Raspberry Pi Imager 1.7 free and open-source flashing utility is now ... website as a DEB binary for Debian/Ubuntu based operating systems, ...
Read more >
How to Install Raspberry Pi Imager on Ubuntu 20.04 LTS ...
Raspberry Pi Imager is a Imaging utility to install. ... root@cyberithub:~# snap install rpi-imager rpi-imager 1.7.2 from Dave Jones ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found