### Runtime errors * LIBUSB_ERROR_BUSY * Linux: detach_kernel_driver (Example in #174) * LIBUSB_ERROR_ACCESS * macOS: Can't open devices that have a kernel driver, no good workaround. (discussion on #30) * Usually comes up with HID devices -- is there a recommended libhid library? * Linux: permissions, udev rules * LIBUSB_ERROR_NOT_SUPPORTED * Windows: Bind WinUSB driver with libwdi / Zadig * Mention WCID for custom devices * LIBUSB_ERROR_NO_DEVICE * macOS doesn't configure devices with bDeviceClass=255 "vendor defined" (#61) * If it's your firmware, use bDeviceClass=0 "defined at interface level" instead * workaround is `.open(false)`, `.setConfiguration(1)` to tell the kernel to configure the device. ### Install errors * Install fails with `gyp WARN EACCES user "root" does not have permission to access the dev dir` (#175, #210, #218) * Don't run npm as root. Best way is to install node via nvm, which sets up permissions correctly to run `npm -g` as your normal user. * Or if you really have to, `npm install --unsafe-perm usb`. * Common issue for all NPM packages with native code nodejs/node-gyp#454 (comment)
Runtime errors
.open(false),.setConfiguration(1)to tell the kernel to configure the device.Install errors
gyp WARN EACCES user "root" does not have permission to access the dev dir(Failed at the usb@1.2.0 install script.. #175, user "root" does not have permission to access the dev dir "/home/pi/scanner/node_modules/usb/.node-gyp/8.9.2" #210, npm ERR! Failed at the usb@1.3.1 install script 'node-pre-gyp install --fallback-to-build'. #218)npm -gas your normal user.npm install --unsafe-perm usb.