节点模块是针对不同的节点模块67编译的

时间:2019-05-22 03:58:24

标签: node.js electron electron-packager

我有一个在节点模块版本67下编译的节点项目,但是现在我收到一个错误,它要求节点模块版本69。

usb_bindings.node was compiled against a different Node.js version using
NODE_MODULE_VERSION 67. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).at process.module.(anonymous function) [as dlopen]

有人知道我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您可能是指编译node-usb模块, 本文介绍如何正确地重新编译 https://electronjs.org/docs/tutorial/using-native-node-modules

cd /path-to-module/
npm install -g node-gyp
node-gyp rebuild --target=1.2.3 --arch=x64 --dist-url=https://electronjs.org/headers
//replace target version with your version of electron