Using electron-usb with electron

自闭症网瘾萝莉.ら 提交于 2019-12-10 19:57:22

问题


I tried is to include electron-usb library into my electron-project.

When I execute npm start with require('electron-usb') in my index.html file an error occurs in the console:

Uncaught Error: The specified procedure could not be found.
\\?\C:\Users\Me\Documents\GitHub\electron-quick-start-master\electron-quick-start-master\node_modules\electron-usb\build\Release\electron-v0.36-win32-x64\usb_bindings.node

This error occurs in the file ELECTRON_ASAR.js Click here to see it

What did I do wrong? I assume I have to somehow configure the module therewith it works with electron but I don't know how.


回答1:


I had the same problem last year. I solved it and use electron everyday to access various USB devices.

my solution is to use current version of electron-usb with electron-prebuilt@1.0.2 It must be that version or lower. Reason is older versions of electron uses node ver 5.x. Electron-usb does not work with Node greater than ver 5.x. It sucks cause I would like to use the newest features of latest Electron and node 7.

When I started this project a couple of years ago there was exactly zero info on the subject. I know how frustrating it can be. I Will be glad to help you getting started if you need it.




回答2:


This could be caused by a wrong Electron version (see this issue for a similar problem: kinect2)

Basically you should try compiling and running with the build script default version.



来源:https://stackoverflow.com/questions/39621113/using-electron-usb-with-electron

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!