Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printer.js MODULE_NOT_FOUND after compiling project with pkg #307

Open
SemionVino opened this issue Apr 19, 2021 · 1 comment
Open

printer.js MODULE_NOT_FOUND after compiling project with pkg #307

SemionVino opened this issue Apr 19, 2021 · 1 comment

Comments

@SemionVino
Copy link

I've compiled my project to an .exe file with pkg. If i run the .exe file on the same computer where i installed printer.js then everything is fine. If i run it on a different computer, then the package cannot find the printer module. Here's the error:

`pkg/prelude/bootstrap.js:1359
throw error;
^

[Function.Module._resolveFilename (internal/modules/cjs/loader.js:1027:15),Function._resolveFilename (pkg/prelude/bootstrap.js:1459:46),Function.Module._load (internal/modules/cjs/loader.js:896:27),Module.require (internal/modules/cjs/loader.js:1087:19),Module.require (pkg/prelude/bootstrap.js:1338:31),require (internal/modules/cjs/helpers.js:73:18),Object. (C:\snapshot\ckiosk\node_modules\printer\lib\printer.js:12:22),Module._compile (pkg/prelude/bootstrap.js:1433:22),Object.Module._extensions..js (internal/modules/cjs/loader.js:1218:10),Module.load (internal/modules/cjs/loader.js:1047:32)] {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\snapshot\ckiosk\node_modules\printer\lib\printer.js',
'C:\snapshot\ckiosk\controllers\receiptController.js',
'C:\snapshot\ckiosk\api\ajax.js',
'C:\snapshot\ckiosk\webApp.js',
'C:\snapshot\ckiosk\main.js'
],

pkg: true
}`

@conquera99
Copy link

you can copy the node_printer.node from /node_modules/printer/lib/node_printer.node to your pkg output .exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants