Skip to content

`react-scripts build` failed with error code ELIFECYCLE, errno 1 while adding 'node-thermal-printer' in src/index.js

Notifications You must be signed in to change notification settings

rambabusaravanan/error-create-react-app

Repository files navigation

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

  1. node -v: v8.0.0
  2. npm -v: 5.0.0
  3. yarn --version (if you use Yarn): NA
  4. npm ls react-scripts (if you haven’t ejected): [email protected]

Then, specify:

  1. Operating system: Ubuntu 16, Zorin OS 12.1
  2. Browser and version (if relevant): NA

Steps to Reproduce

  1. create a fresh app using create-react-app and $ npm install --save node-thermal-printer
  2. add the line import 'node-thermal-printer' in src/index.js
  3. $ npm run build

Expected Behavior

Successful Build.

Actual Behavior

Failed to compile with error code ELIFECYCLE, errno 1

Terminal

$ npm run build

[email protected] build /home/andro/smartd.workspace/pos-space/sample-printer react-scripts build

Creating an optimized production build... Failed to compile.

static/js/main.47fb6eaa.js from UglifyJs Unexpected token: name (i) [./~/node-thermal-printer/node-thermal-printer.js:403,0][static/js/main.47fb6eaa.js:20938,12]

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: react-scripts build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/andro/.npm/_logs/2017-06-27T16_14_58_135Z-debug.log

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 perform npm 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 like

  • static .js (public folder) and linked to index.html (renderer process)
  • electron's main process (main.js)

But the code fails, when I add the same code in src/index.js where react-scripts build failed with error code ELIFECYCLE, errno 1

About

`react-scripts build` failed with error code ELIFECYCLE, errno 1 while adding 'node-thermal-printer' in src/index.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published