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

"Could not initialize libusb. Check that your system has a usb controller." on Travis CI #194

Closed
jviotti opened this issue Aug 15, 2017 · 7 comments

Comments

@jviotti
Copy link

jviotti commented Aug 15, 2017

For some reason I get that error only when running inside a Travis CI job.

I tracked down the error to libusb_init (http://libusb.sourceforge.net/api-1.0/group__lib.html#ga9517c37281bba0b51cc62eba728be48b). Do you have any clues about why that's failing, and how we can at least workaround it?

@jviotti
Copy link
Author

jviotti commented Aug 15, 2017

We run our builds inside Docker, so maybe that's the issue?

adenvt added a commit to adenvt/recta-host that referenced this issue Aug 20, 2017
@adenvt
Copy link

adenvt commented Aug 21, 2017

Got same error on VPS too, i think because it hasn't usb controller.

BTW, Is there any way to catch error... ?

@sebakerckhof
Copy link

same issue here, it's indeed because it doesn't have a usb controller

@nickmetal
Copy link

Have same problem with using Windows(10). It fired when I just running webpack devserver without using any usb devices. With OS X and Linux work well

@agirorn
Copy link

agirorn commented Jul 30, 2018

Why does this module throw this error here usb.js#L11 this means that every code that requires this module needs to guard it is self against this (bug I think) even if it is not going to use the USB, and just wants go require it in the top of the js file and then later on do some feature detection.

Since the property INIT_ERROR is already on the module it should be enough to silently ignore this and allow the user of the module to decide how he want's to handle this scenario.

Would you accept a pull request that removes this check and adds the available function a simple and clean API to check if USB has been detected?

usb.available = () => !usb.INIT_ERROR;

@kevinmehall
Copy link
Contributor

@agirorn If you want to make a PR removing this throw, I think the better API would be to check whether initialization failed in getDeviceList and anything else that can be called without a device, and make those functions throw an exception.

@webmaster128
Copy link

I'd be happy for feedback on the way @kevinmehall described implemented in #260

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

7 participants