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.

Failing to build on Raspberry Pi

See original GitHub issue

I am having some issues with this package on my Pi. The output is as follows:

npm install usb
\
> usb@1.1.0 install /home/scott/.node-red/node_modules/usb
> node-pre-gyp install --fallback-to-build

make: Entering directory '/home/scott/.node-red/node_modules/usb/build'
  CC(target) Release/obj.target/libusb/libusb/libusb/core.o
  CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
  CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
  CC(target) Release/obj.target/libusb/libusb/libusb/io.o
  CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
  CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
../libusb/libusb/os/threads_posix.c:24:0: warning: "_GNU_SOURCE" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
  CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
  AR(target) Release/obj.target/usb.a
  COPY Release/usb.a
  CXX(target) Release/obj.target/usb_bindings/src/node_usb.o
  CXX(target) Release/obj.target/usb_bindings/src/device.o
../src/device.cc: In static member function ‘static v8::Local<v8::Object> Device::get(libusb_device*)’:
../src/device.cc:47:19: error: ‘class std::map<libusb_device*, Nan::Persistent<v8::Object> >’ has no member named ‘emplace’
../src/device.cc:47:37: error: unable to deduce ‘auto’ from ‘<expression error>’
usb_bindings.target.mk:96: recipe for target 'Release/obj.target/usb_bindings/src/device.o' failed
make: *** [Release/obj.target/usb_bindings/src/device.o] Error 1
make: Leaving directory '/home/scott/.node-red/node_modules/usb/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 4.1.7-v7+
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/scott/.node-red/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/home/scott/.node-red/node_modules/usb/src/binding"
gyp ERR! cwd /home/scott/.node-red/node_modules/usb
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/scott/.node-red/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/scott/.node-red/node_modules/usb/src/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/scott/.node-red/node_modules/usb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1015:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
node-pre-gyp ERR! System Linux 4.1.7-v7+
node-pre-gyp ERR! command "node" "/home/scott/.node-red/node_modules/usb/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/scott/.node-red/node_modules/usb
node-pre-gyp ERR! node -v v0.12.7
node-pre-gyp ERR! node-pre-gyp -v v0.6.4
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/scott/.node-red/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/scott/.node-red/node_modules/usb/src/binding' (1)
npm ERR! Linux 4.1.7-v7+
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "usb"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! usb@1.1.0 install: `node-pre-gyp install --fallback-to-build`

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

npm ERR! Please include the following file with any support request:
npm ERR!     /home/scott/.node-red/npm-debug.log

Any ideas on how to debug and fix it?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinmehallcommented, Nov 14, 2015

If you install from a git:// url, npm doesn’t clone the libusb submodule, so it fails to build. Fetch the source with git clone --recursive https://github.com/nonolith/node-usb, cd in and npm install.

0reactions
scottswebcommented, Nov 15, 2015

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build fails on Raspberry Pi · Issue #30 · davidmoreno/rtpmidid
Possibly trivial to fix, but I'm very bad at cmake builds (sorry). Running Raspbian on Raspberrry Pi 3 uname -a Linux raspberrypi 5.4.51-v7+ ......
Read more >
Build Failure - Raspberry Pi Forums
Hello all, I am trying to compile micropython for the pico w based on the instructions in https://datasheets.raspberrypi.com/pico ... ico-w.
Read more >
Python fails to compile on Raspberry Pi - Stack Overflow
I am trying to compile Python 3.6 on Raspberry Pi Jessie following the instructions here and I am getting the following error:.
Read more >
Failed building wheel for pandas on model 3B+
I'm trying to install pandas in a Python virtualenv on a RPi model 3B+, but its wheel fails to build. Pandas does however...
Read more >
Failing to build Kodi Matrix 19.4 on Raspberry Pi 2 - cmake ...
Hi, noticed the folks at LibreELEC released 10.0.3 based on Kodi 19.4. Tested it and liked it - planning to move from Kodi...
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