电子NODE_MODULE_VERSION的串行端口错误和重建无法解决 [英] serialport for electron NODE_MODULE_VERSION error and rebuild does not fix
问题描述
OS:赢10Node.js:v12.18.3电子:v10.1.1
OS: win 10 Node.js : v12.18.3 electron: v10.1.1
打印版本:process.versions.node 12.16.3process.versions.modules 82
print version from js program: process.versions.node 12.16.3 process.versions.modules 82
-
通过以下方式安装serialport:npm install serialport
install serialport by: npm install serialport
npm启动并出现错误:
npm start and get error:
错误:模块'\?\ D:\ node \ Tester \ node_modules @ serialport \ bindings \ build \ Release \ bindings.node'是使用不同的Node.js版本编译的NODE_MODULE_VERSION 72.此版本的Node.js需要NODE_MODULE_VERSION 82.请尝试重新编译或重新安装模块(例如,使用 npm rebuild
或 npm install
).
Error: The module '\?\D:\node\Tester\node_modules@serialport\bindings\build\Release\bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 82. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
- npm install --save-dev electronic-rebuild.\ node_modules.bin \ electron-rebuild
重建完成
- npm开始和错误再次出现.
错误:模块'\?\ D:\ node \ Tester \ node_modules @ serialport \ bindings \ build \ Release \ bindings.node'是使用不同的Node.js版本编译的NODE_MODULE_VERSION 72.此版本的Node.js需要NODE_MODULE_VERSION 82.请尝试重新编译或重新安装模块(例如,使用 npm rebuild
或 npm install
).
Error: The module '\?\D:\node\Tester\node_modules@serialport\bindings\build\Release\bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 82. Please try re-compiling or re-installing
the module (for instance, using npm rebuild
or npm install
).
应该注意的是,v12.18.3和12.16.3均具有NODE_MODULE_VERSION72.没有版本获得82.我不知道'82'的来源.我该如何抚弄呢?谢谢.
What should be noticed is, both v12.18.3 and 12.16.3 has NODE_MODULE_VERSION 72. and no version gets 82. I don't know where the '82' comes from. How can I sovle it? Thanks.
推荐答案
今天早上我遇到了同样的问题.经过5个多小时的故障排除,对我而言唯一有效的方法是将电子重建版本降级为v2.0.1.我正在使用节点v14.9.0(最新),电子v10.1.1(最新),串行端口v9.0.1(最新)
I had the same issue this morning. With over 5 hours of troubleshooting the only thing that worked for me was to downgrade electron-rebuild to v2.0.1. I am using node v14.9.0(latest), electron v10.1.1(latest), serialport v9.0.1(latest)
似乎他们有一个未解决的问题: https://github.com/electron/electron-rebuild/issues/404
Looks like they have an issue open: https://github.com/electron/electron-rebuild/issues/404
这篇关于电子NODE_MODULE_VERSION的串行端口错误和重建无法解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!