Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

六月ゝ 毕业季﹏ 提交于 2019-11-29 02:52:23

问题


I've successfully built node.js addon, which works well with Node on Windows. Now, I want to create a Windows app using Electron. When loading the module in HTML file, I got the error:

var dbr = require('./build/Release/dbr');

Something wrong with ATOM_SHELL_ASAR.js.

The issue only occurred on Windows. On Linux and Mac, it worked well.

How can I fix it?

Thanks!


回答1:


You need to rebuild your native Node addon for Electron, the steps are outlined in the docs.




回答2:


I'm using Electron 2 version and have the same error with another module.

I solved this problem by this advise on Electron page: To ensure your native dependencies are always matched electron version, simply add script "postinstall": "electron-builder install-app-deps" to your package.json.

And then I changed: "postinstall": "electron-builder install-app-deps && npm run lint:fix". Then npm run postinstall.



来源:https://stackoverflow.com/questions/36029955/electron-uncaught-error-a-dynamic-link-library-dll-initialization-routine-fai

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