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

Error in escpos-usb line 52 usb.on() not working #409

Open
jmrg-link opened this issue Oct 4, 2022 · 4 comments
Open

Error in escpos-usb line 52 usb.on() not working #409

jmrg-link opened this issue Oct 4, 2022 · 4 comments

Comments

@jmrg-link
Copy link

Error line usb.on comment line .
Printer not init .
escpos-usb -> index
line comments
/*
usb.on('detach', function(device){
if(device == self.device) {
self.emit('detach' , device);
self.emit('disconnect', device);
self.device = null;
}
});
*/

@XavierTM
Copy link

I think the issue is being caused by the utils.inherit() which is deprecated. I fixed this by copying all the code in the escpos-usb module into a file, commenting out that part, then requiring that file instead.

@apaleslimghost
Copy link

this is because escpos-usb has a wildcard dependency on usb, which means it's pulling in versions with breaking changes it's not compatible with. with recent versions of npm you can fix this by adding a version override for usb to your package.json:

  "overrides": {
    "usb": "1.8.8"
  }

@wxuefei
Copy link

wxuefei commented Apr 8, 2023

you can try : usb.usb.on ...

@denkol
Copy link

denkol commented Oct 5, 2023

Was the same problem. @apaleslimghost solution helps.

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

5 participants