npm install usb
This command don't work ?
In order to install a library into your Edison, first you have to make sure that your device has a wifi connection, if you're not sure you have it you can type from the Linux shell configure_edison --wifi and follow the set up instructions. Now that you have wifi connectivity, type npm install usb, in the next picture I'll show you the files it installed on my Edison.
Also check the dependencies of the library make sure they're installed, otherwise the library won't work.
Thanks for the responses. I'm starting with this version (I didn't build it I downloaded it) edison-rel1-maint-weekly_build_16_2014-10-14_14-56-19.
When I run: npm install usb, it looks like your screen shot above until the build fails because it can't find libusb-1.0
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
gyp: Call to 'pkg-config libusb-1.0 --libs' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
You said you downloaded it, could have been that the download was corrupted? Why don't you try downloading it again? Maybe you can try another repository?
I figured it out. The released flash image does not include libusb-1.0-dev. Without that there is no libusb.h on the system so the node_usb build fails.
I followed the instructions in this thread to point to AlexT's repo and install libusb-1.0-dev: Edison opkg package repo created.
His instructions are here: http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html
After editing the base feeds the following worked:
root@bilbo:/etc/opkg# opkg install libusb-1.0-dev
Installing libusb-1.0-dev (1.0.9-r1) to root...
root@bilbo:~# npm instal usb
npm http GET https://registry.npmjs.org/usb
npm http 304 https://registry.npmjs.org/usb
npm http GET https://registry.npmjs.org/usb-shyp-darwin-x64
npm http GET https://registry.npmjs.org/bindings-shyp
npm http GET https://registry.npmjs.org/usb-shyp-win32-ia32
npm http GET https://registry.npmjs.org/usb-shyp-win32-x64
npm http 304 https://registry.npmjs.org/usb-shyp-win32-ia32
npm http 304 https://registry.npmjs.org/usb-shyp-darwin-x64
npm http 304 https://registry.npmjs.org/usb-shyp-win32-x64
npm http 304 https://registry.npmjs.org/bindings-shyp
npm WARN optional dep failed, continuing firstname.lastname@example.org
npm WARN optional dep failed, continuing email@example.com
npm WARN optional dep failed, continuing firstname.lastname@example.org
> email@example.com install /home/root/node_modules/usb
> node shyp-blacklist.js win32-x64 win32-ia32 darwin-x64 || node-gyp rebuild
make: Entering directory '/home/root/node_modules/usb/build'
SOLINK_MODULE(target) Release/obj.target/usb_bindings.node: Finished
make: Leaving directory '/home/root/node_modules/usb/build'
I'm glad you were able to make it work. As always, if you have any more doubts, don't hesitate to ask.