Print using node-printer module in Windows


#1

I’m trying to use the node-printer in an electron application in Windows, but I get this error when trying to import the module

Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Users\Jdash\Documents\GitLab\ezparking\node_modules\printer\build\Release\node_printer.node

Outside electron the node-printer module works fine for my examples.

Can I have some advice on how to solve this?


#2

Native modules must be rebuilt specifically for the Electron version you’re using, as documented here.


#3

I tried the easy way:

# On Windows if you have trouble, try:
.\node_modules\.bin\electron-rebuild.cmd

I used:

C:\Users\Jdash\Documents\GitLab\ezparking>.\node_modules\.bin\electron-rebuild.cmd

But I don’t get any feedback from the command. I guess it did the job, but when I execute electron . I get the same error.