lsongdev / node-escpos

🖨️ ESC/POS Printer driver for Node.js
https://npmjs.org/escpos
Other
1.38k stars 423 forks source link

[BUG]: byte = ''; ^ SyntaxError: Unexpected token = at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) #434

Open khaing17 opened 3 months ago

khaing17 commented 3 months ago

Description of the bug

every time i run the node script, i get this error `byte = ''; ^

SyntaxError: Unexpected token = at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/home/superuser/Desktop/work/thermal_printer_example/node_modules/escpos/index.js:12:18) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) `

Steps To Reproduce

this is my code `const escpos = require("escpos");

// escpos.Bluetooth = require('escpos-bluetooth'); escpos.USB = require("escpos-usb"); escpos.SerialPort = require("escpos-serialport"); const serialDeviceOnLinux = new escpos.SerialPort("/dev/usb/lp2", { baudRate: 14400, stopBit: 2, });

console.log(serialDeviceOnLinux); `

Additional Information

No response