Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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');

enter image description here

Something wrong with ATOM_SHELL_ASAR.js. enter image description here

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

How can I fix it?

Thanks!

like image 968
yushulx Avatar asked Mar 16 '16 08:03

yushulx


2 Answers

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

like image 195
Vadim Macagon Avatar answered Sep 20 '22 15:09

Vadim Macagon


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.

like image 31
max1119 Avatar answered Sep 20 '22 15:09

max1119