Closed rambabusaravanan closed 7 years ago
have you tried with node 6 or 7?
This is the relevant line:
Unexpected token: name (i) [./~/node-thermal-printer/node-thermal-printer.js:403,0][static/js/main.47fb6eaa.js:20938,12]
It says on line 403 there's syntax Uglify doesn't understand.
Indeed, it's ES6:
let i = "QRCODE_CELLSIZE_".concat(settings.cellSize.toString())
If you compile the package down to ES5 before publishing, the issue will be fixed. You can use Babel for this.
Hope it helps, and thanks for a great issue report!
@viankakrisna I just installed and tried with the versions v6.11.0 and v7.10.0. Still facing the same error.
@gaearon Thanks for your answer.
As of I understood, the npm package 'node-thermal-printer' needs to be compiled down to ES5 before publishing for the reason Uglify doesn't understand a snippet in it. Am I correct?
Will it make sense, if i raise this as issue in 'node-thermal-printer' repository?
Yes, this is correct! For some reason I assumed at first that you published that package—sorry for misunderstanding.
I've been encountering this issue frequently while developing on AWS... I am pretty sure that it is related to poor connectivity between my workstation, my VPC, and my RDS service. Do you have suggestions on how to make startup more robust - able to recover from what I assume to be connection errors. Thanks.
Is this a bug report?
Yes
Can you reproduce the problem with npm 4.x?
Yes
Have you read the Troubleshooting section and searched the User Guide?
ELIFECYCLE, react-scripts build
Environment
node -v
: v8.0.0npm -v
: 5.0.0yarn --version
(if you use Yarn): NAnpm ls react-scripts
(if you haven’t ejected): react-scripts@1.0.7Then, specify:
Steps to Reproduce
$ npm install --save node-thermal-printer
import 'node-thermal-printer'
insrc/index.js
$ npm run build
Expected Behavior
Successful Build.
Actual Behavior
Failed to compile with error code ELIFECYCLE, errno 1
Terminal
Log File https://github.com/rambabusaravanan/error-create-react-app/blob/master/2017-06-27T16_14_58_135Z-debug.log
Reproducible Demo
https://github.com/rambabusaravanan/error-create-react-app checkout the latest commit and
npm install
and performnpm run build
I'm building a cross-platform desktop app using electron and react and I'm using npm package 'node-thermal-printer' for usb thermal printer. The printer code works fine in the places where
react-scripts build
doesn't involve likeBut the build fails, when I add the same code in
src/index.js
wherereact-scripts build
failed with error code ELIFECYCLE, errno 1