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

Can't import the library #6

Open
kewynakshlley opened this issue Nov 21, 2023 · 1 comment
Open

Can't import the library #6

kewynakshlley opened this issue Nov 21, 2023 · 1 comment

Comments

@kewynakshlley
Copy link

Receiving this error:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\kewyn\Documents\projects\bot\node_modules\thermal-printer-encoder\package.json
at new NodeError (node:internal/errors:393:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:292:9)
at packageExportsResolve (node:internal/modules/esm/resolve:546:7)
at resolveExports (node:internal/modules/cjs/loader:529:36)
at Module._findPath (node:internal/modules/cjs/loader:569:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:981:27)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (C:\Users\kewyn\Documents\projects\bot\index.js:1:35) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

let ThermalPrinterEncoder = require('thermal-printer-encoder');


let encoder = new ThermalPrinterEncoder({ 
  language: 'esc-pos',
  width:      48,
  wordWrap:   true
});

let result = encoder
    .initialize()
    .codepage('auto')
    .text('The quick brown fox jumps over the lazy dog')
    .italic(true)
    .newline()
    .barcode('3130630574613', 'itf', 60)
    .encode();

console.log(result);

Node.js v19.0.0
Npm 9.6.1

@andreiwow2
Copy link

I'm encountering the same issue, I can't get it to work

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