Module version mismatch. Expected 49, got 48

落爺英雄遲暮 提交于 2019-12-02 00:44:38

Since mdns contains a native Node module you must rebuild it to target your version of Electron, there are a couple of ways to do this. I'd suggest using the electron-rebuild approach.

npm rebuild --runtime=electron --target=1.3.4 --disturl=https://atom.io/download/atom-shell --abi=50

in your case it should be 49

This is well-know problem when when upgrading node version. For example: you are using Node for example version 5. You add some libraries inside your project, build and run that. All your libraries will be compiled under node version 5.

And then you upgrade your node for example to version 6. And then you run some commands that using node, for example npm run test. The problem is here: you use newer node version for running libraries that compiled by older node.

Solving this is easy by 2 following commands:

rm -rf node_modules // force remove node_modules directory
npm install         // install again all libraries. Libraries will be compiled again with node version 6

So this is a general method apply for all javascript frameworks, not only electron ...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!