thiagoelg / node-printer

Native node.js printer
125 stars 75 forks source link

Error: Module did not self-register and prebuild-install failed with error #76

Open adnanlah opened 3 months ago

adnanlah commented 3 months ago

Hello,

I am having a problem trying to install and use this package in my Electron app. It worked fine in a Node.js app but not with Electron.

I have Electron.js version 28.2.0 and Node.js v18.18.1 installed.

When I try to install the package app I get this error:

build native dependency from sources  name=@thiagoelg/node-printer
                                          version=0.6.2
                                          platform=win32
                                          arch=x64
                                          napi=
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 7.1.1
    prebuild-install warn install prebuilt binaries enforced with --force!
    prebuild-install warn install prebuilt binaries may be out of date!

and I get this error when I try to run the app:

App threw an error during load
Error: Module did not self-register: '\\?\C:\Users\ADNAN\dev\****\node_modules\@thiagoelg\node-printer\lib\node_printer.node'.
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2214)
    at Module._extensions..node (node:internal/modules/cjs/loader:1356:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2214)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at Module._load (node:internal/modules/cjs/loader:967:12)
    at c._load (node:electron/js2c/node_init:2:13672)
    at Module.require (node:internal/modules/cjs/loader:1150:19)
    at require (node:internal/modules/cjs/helpers:119:18)

I have installed Desktop Development with C++ and Node.js development workloads installed.

image

We would really appreciate a fix for this as this package is essential for the the node-thermal-printer to work and I didn't find any alternative.

Thank you very much.

Blair2004 commented 1 week ago

Hi, so bad there is no update on this, I'm also facing the same issue.