在做一个项目。为node构建了C++模块,并用cmake进行了编译。我试着在我的主要电子应用程序中使用该模块,但它出错。
在这里用最小的repo重现了它:https://github.com/Aerrus/electronMinimal
App threw an error during load
Error: Module did not self-register.
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
at Module.load (internal/modules/cjs/loader.js:602:32)
at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
at Function.Module._load (internal/modules/cjs/loader.js:533:3)
at Module.require (internal/modules/cjs/loader.js:640:17)
at require (internal/modules/cjs/helpers.js:20:18)
at bindings (C:\Users\xxx\electronMinimal\mods\node_modules\bindings\bindings.js:112:48)
at Object.<anonymous> (C:\Users\xxx\electronMinimal\mods\index.js:1:188)我已经看到了很多关于重新构建它的线索,确保我构建它时的节点版本是相同的,等等。他们都没有改变任何事情。
发布于 2019-04-26 14:18:03
如果你使用的是电子4.0版,看看这个。我希望这会有帮助,因为这是我解决问题的方法
https://stackoverflow.com/questions/54508863
复制相似问题