tojocky / node-printer

Native node.js printer
1.54k stars 443 forks source link

Uncaught Error: A dynamic link library (DLL) initialization routine failed. #177

Open quansync opened 7 years ago

quansync commented 7 years ago

Please Help me, How I solved This Error Uncaught Error: A dynamic link library (DLL) initialization routine failed. \?\D:\electron_project\tes5\node_modules\printer\build\Release\node_printer.node at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20) at Object.Module._extensions..node (module.js:598:18) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (D:\electron_project\tes5\node_modules\printer\lib\printer.js:10:22) at Object. (D:\electron_project\tes5\node_modules\printer\lib\printer.js:326:3)

DTeuchert commented 7 years ago

I got the same error message after installing the printer library via npm (npm install printer) to use it in my electron project on a windows machine.

It seems the installation was completed successfully:

PS C:\Projects\Printer> npm install printer

> printer@0.2.2 install C:\Projects\Printer\node_modules\printer
> node-gyp rebuild
 [...]
+ printer@0.2.2
updated 1 package in 17.403s

As soon as I start the electron project, the error message prompt:

PS C:\Projects\Printer> npm start

> printer@1.0.0 start C:\Projects\Printer
> electron .

App threw an error during load
Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Projects\Printer\node_modules\printer\build\Release\node_printer.node
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Projects\Printer\node_modules\printer\lib\printer.js:10:22)
    at Object.<anonymous> (C:\Projects\Printer\node_modules\printer\lib\printer.js:326:3)

Any suggestions? Thanks

likyh commented 7 years ago

i got a same wrong, who can help me……

epver commented 6 years ago

me to, when I start by electron, well occur this error

zetogk commented 6 years ago

Go to node_modules/printer and run "node-gyp rebuild --target=1.7.8 --arch=x64" target should be the same version of Electron and arch can be x64 or ia32