electron-Node.js Error: Module version mismatch. Expected

本来以为是nodejs的版本问题,后来才发现是electron用本地包的问题
Installing modules and rebuilding for Electron
You can also choose to install modules like other Node projects, and then rebuild the modules for Electron with the electron-rebuild package. This module can get the version of Electron and handle the manual steps of downloading headers and building native modules for your app.

An example of installing electron-rebuild and then rebuild modules with it:

npm install --save-dev electron-rebuild

Every time you run "npm install", run this:

./node_modules/.bin/electron-rebuild

On Windows if you have trouble, try:

.\node_modules.bin\electron-rebuild.cmd

posted @ 2016-09-10 07:17  蚂蚁都督  阅读(534)  评论(0编辑  收藏  举报