【发布时间】:2017-12-07 04:34:13
【问题描述】:
我正在尝试安装this Electron project。它使用两个 package.json 结构并且是为 Electron 1.7.2 编写的。所有依赖项都安装得很好,setup instructions 包括运行 electron-rebuild,它也可以毫无怨言地运行。但是,当我运行 npm run dev 时,会打开一个空窗口,控制台中会显示以下内容:
Uncaught Error: The module '[...]/sciencefair/app/node_modules/webworker-threads/build/Release/WebWorkerThreads.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. 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] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at bindings (/[...]/sciencefair/app/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/[...]/sciencefair/app/node_modules/webworker-threads/index.js:1:198)
我尝试安装与 Electron 1.7.2 所针对的完全相同版本的 Node.js (7.9.0),但无论是否运行 electron-rebuild,我都得到了相同的结果。
我是一个网络人,没有真正的 Electron 经验。系统:Ubuntu LTS 16.04
【问题讨论】:
标签: javascript node.js npm electron ubuntu-16.04