本文介绍了模块版本不匹配.预期 49,得到 48的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 Electron 模块 mdns,但出现此错误
I am using Electron module mdns and I am getting this error
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Module version mismatch. Expected 49, got 48.
at Error (native)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:167:20)
at Object.Module._extensions..node (module.js:568:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:167:20)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/ingsaurabh/dp/node_modules/mdns/lib/dns_sd.js:24:20)
卸载节点模块并重新安装,但无法正常工作
Uninstalled node module and reinstalled, but not working
推荐答案
由于 mdns
包含本机 Node 模块,您必须重新构建它以针对您的 Electron 版本,有 几种方法来做到这一点.我建议使用 electron-rebuild
方法.
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.
这篇关于模块版本不匹配.预期 49,得到 48的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!