【问题标题】:bindings.node' was compiled against a different Node.js version usingNODE_MODULE_VERSION 93. This version of Node.js requires NODE_MODULE_VERSION 89bindings.node' 是针对不同的 Node.js 版本使用 NODE_MODULE_VERSION 93 编译的。此版本的 Node.js 需要 NODE_MODULE_VERSION 89
【发布时间】:2022-01-06 06:47:54
【问题描述】:

我正在尝试让一个电子应用程序在我的电脑上运行。在ubuntu上它可以工作,我遇到了windows问题。当我尝试运行我的应用程序时出现此错误

模块 '\?\C:\Users\david\Desktop\Serial_Communication\node_modules@serialport\bindings\build\Release\bindings.node' 使用
针对不同的 Node.js 版本编译 NODE_MODULE_VERSION 93. 此版本的 Node.js 需要
NODE_MODULE_VERSION 89.
请尝试重新编译或重新安装 模块(例如,使用 npm rebuildnpm install)。
在 process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
在 Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
在 Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
在 Module.load (internal/modules/cjs/loader.js:935:32)
在 Module._load (internal/modules/cjs/loader.js:776:14)
在 Function.f._load (electron/js2c/asar_bundle.js:5:12913)
在 Module.require (internal/modules/cjs/loader.js:959:19)
在需要(内部/模块/cjs/helpers.js:88:18)
在绑定处 (C:\Users\david\Desktop\Serial_Communication\node_modules\bindings\bindings.js:112:48)
在对象。 (C:\Users\david\Desktop\Serial_Communication\node_modules@serialport\bindings\lib\win32.js:1:36)

我已经尝试过 npm install、npm rebuild、electron-rebuild,但还是不行。对我来说似乎也很奇怪,它建议我使用旧版本的 Node,有什么想法吗? 谢谢

【问题讨论】:

    标签: javascript node.js binding electron electron-builder


    【解决方案1】:

    我解决了这个问题。我用这个链接https://github.com/serialport/node-serialport/releases/tag/%40serialport%2Fbindings%409.2.0,下载了绑定模块的v89版本。然后我手动将该版本导入@serialport/bindings 文件夹。

    【讨论】:

      猜你喜欢
      • 2019-12-03
      • 2020-12-22
      • 2018-03-05
      • 2021-04-18
      • 2018-11-21
      • 2021-02-19
      • 1970-01-01
      • 2019-07-28
      相关资源
      最近更新 更多