使用电子usb和电子 [英] Using electron-usb with electron

查看:120
本文介绍了使用电子usb和电子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将 electron-usb 库包含到我的电子项目中。

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

当我执行 npm start with require('electron-usb') index.html 文件中的code>在控制台中发生错误:

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

此错误发生在文件ELECTRON_ASAR.js
点击此处查看

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.

推荐答案

我有去年同样的问题。我解决了它并每天使用电子来访问各种USB设备。

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

我的解决方案是使用当前版本的electron-usb和electron-prebuilt@1.0.2
必须是该版本或更低版本。原因是旧版本的电子使用节点版本5.x. Electron-usb不适用于大于版本5.x的Node。这很糟糕,因为我想使用最新的Electron和节点7的最新功能。

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.

这篇关于使用电子usb和电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆