尝试运行电子项目时的不同编译版本

时间:2017-10-30 01:30:57

标签: node.js electron node-gyp

我目前正在尝试使用电子和节点gyp为c插件创建节点js项目。但是当我尝试使用

运行我的程序时

electron index.js

我收到此错误:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: The module '/home/ubspy/Code/Node-c-test/build/Release/addons.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 54. 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 :(得分:0)

经过多次试验和错误后我发现了这一点,将电子版本升级到模块版本匹配的最新测试版后,程序运行完美。