Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'usb_bindings' #6

Open
ghost opened this issue Jan 26, 2012 · 14 comments
Open

Cannot find module 'usb_bindings' #6

ghost opened this issue Jan 26, 2012 · 14 comments

Comments

@ghost
Copy link

ghost commented Jan 26, 2012

Hi,

I have tried installing the node-usb in my ubuntu11.04. I am getting following error "USB_BINDINGS" module not found. can you help me out on this subject.

root@ubuntu:/home/san# nodejs --version
v0.6.8
root@ubuntu:/home/san# cd node-usb/
root@ubuntu:/home/san/node-usb# make
node-waf configure clean build; nodejs tests/node-usb-test.js
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for libusb-1.0 : yes
'configure' finished successfully (1.996s)
'clean' finished successfully (0.040s)
Waf: Entering directory /home/san/node-usb/build' [1/6] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o [2/6] cxx: src/usb.cc -> build/Release/src/usb_1.o [3/6] cxx: src/device.cc -> build/Release/src/device_1.o [4/6] cxx: src/interface.cc -> build/Release/src/interface_1.o [5/6] cxx: src/endpoint.cc -> build/Release/src/endpoint_1.o [6/6] cxx_link: build/Release/src/node_usb_1.o build/Release/src/usb_1.o build/Release/src/device_1.o build/Release/src/interface_1.o build/Release/src/endpoint_1.o -> build/Release/usb_bindings.node Waf: Leaving directory/home/san/node-usb/build'
'build' finished successfully (6.181s)

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'usb_bindings'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/home/san/node-usb/usb.js:4:15)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
make: *** [make] Error 1
root@ubuntu:/home/san/node-usb#

@schakko
Copy link
Owner

schakko commented Jan 30, 2012

Place the usb_bindings.node file in your node path or in the directory where usb.js is located.

@micha149
Copy link

micha149 commented Apr 4, 2012

Where can I get the usb_bindings.node file? Have the same issue on a debian squeeze.

@schakko
Copy link
Owner

schakko commented Apr 4, 2012

usb_bindings.node resides in build/Release.

@micha149
Copy link

micha149 commented Apr 4, 2012

Sorry. And where to find build/Release?!

@schakko
Copy link
Owner

schakko commented Apr 4, 2012

build/* will be generated by executing make respectively wscript and is inside the node-usb directory.

@micha149
Copy link

micha149 commented Apr 4, 2012

but make dies before the build directory is created. Heres my output:

root@debian-test:~/node-test/node-usb# make
node-waf -v configure clean build; node tests/node-usb-test.js
/bin/sh: node-waf: not found

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module './usb_bindings'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/root/node-test/node-usb/usb.js:4:15)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:32)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
make: *** [make] Fehler 1

@schakko
Copy link
Owner

schakko commented Apr 4, 2012

As your log shows, you do not have node-waf inside your PATH.

 node-waf -v configure clean build; node tests/node-usb-test.js
 /bin/sh: node-waf: not found

node-waf is required for building a node module.

@andySigler
Copy link

i'm getting the same issue, but i'm not getting an error regarding node-waf


$ node tests/node-usb-test.js

module.js:340
throw err;
^
Error: Cannot find module 'usb_bindings'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/Users/andrewsigler/Desktop/nodeUSB/node-usb-master/usb.js:4:15)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)


@skilbjo
Copy link

skilbjo commented Apr 28, 2015

node-waf is not available anymore... node-gyp is the replacement...

@stefek99
Copy link

stefek99 commented May 7, 2016

This is what is happening on my machine:

node examples/lsusb/lsusb.js

Error: Cannot find module './usb_bindings'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/ms/Dropbox/Musafa/dev/node-usb/usb.js:4:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)

Any ideas?

@gdibble
Copy link

gdibble commented May 26, 2016

🙏 also need help.

what i tried so far:

  1. got Command Line Tools for OSX to get make https://developer.apple.com/downloads/
  2. npm i node-gyp -g
  3. open Makefile and replace node-waf with node-gyp
  4. make

result is the same as the fellows above

@koizumikk
Copy link

you can find "usb_bindings" here.

https://github.com/tessel/node-usb/releases

@yasharma
Copy link

After placing usb_bindings.node into directory where usb.js is located, now i am getting following

 (master) -> node usb.js
module.js:434
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /home/yash/node-usb/usb_bindings.node: invalid ELF header
    at Error (native)
    at Object.Module._extensions..node (module.js:434:18)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/yash/node-usb/usb.js:4:15)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)

@JSAbrahams
Copy link

@yasharma That is caused by the fact that the binary is not suited for your OS. I however have the same problem at the moment, so I don't have a solution I'm afraid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants