question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running eslint as an npm script results in ELIFECYCLE error.

See original GitHub issue

I’m using eslint 0.19.0 installed in a local package. I am on node v0.12.2 and npm v2.7.5

I have an npm script in my package.json set up just like the snippet below. When I run ./node_modules/.bin/eslint app eslint runs exactly as I would expect it to. When I run npm run eslint eslint seems to run fine but I then get a nasty error at the bottom of the output. I’ve pasted the npm-debug.log file below. Any idea why this is happening and how I can fix it?

"scripts": {
    "eslint": "eslint app"
}

0 info it worked if it ends with ok 1 verbose cli [ ‘node’, ‘/usr/local/bin/npm’, ‘run’, ‘eslint’ ] 2 info using npm@2.8.4 3 info using node@v0.12.2 4 verbose node symlink /usr/local/bin/node 5 verbose run-script [ ‘preeslint’, ‘eslint’, ‘posteslint’ ] 6 info preeslint ccapp@1.0.0 7 info eslint ccapp@1.0.0 8 verbose unsafe-perm in lifecycle true 9 info ccapp@1.0.0 Failed to exec eslint script 10 verbose stack Error: ccapp@1.0.0 eslint: eslint app/ 10 verbose stack Exit status 1 10 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16) 10 verbose stack at EventEmitter.emit (events.js:110:17) 10 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 10 verbose stack at ChildProcess.emit (events.js:110:17) 10 verbose stack at maybeClose (child_process.js:1015:16) 10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5) 11 verbose pkgid ccapp@1.0.0 12 verbose cwd /Users/mhaas2/projects/prototypes/ccapp 13 error Darwin 14.3.0 14 error argv “node” “/usr/local/bin/npm” “run” “eslint” 15 error node v0.12.2 16 error npm v2.8.4 17 error code ELIFECYCLE 18 error ccapp@1.0.0 eslint: eslint app/ 18 error Exit status 1 19 error Failed at the ccapp@1.0.0 eslint script ‘eslint app/’. 19 error This is most likely a problem with the ccapp package, 19 error not with npm itself. 19 error Tell the author that this fails on your system: 19 error eslint app/ 19 error You can get their info via: 19 error npm owner ls ccapp 19 error There is likely additional logging output above. 20 verbose exit [ 1, true ]

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

88reactions
michaelficarracommented, May 20, 2015

eslint ...; exit 0?

5reactions
jeremenichellicommented, Jan 5, 2016

Though that solves the npm error log, it’s not recommendable since you might want to concat commands like linting and then bundling with browserify, and the second one will occur even if you have code to fix. To be honest it also bothers me the error logging in the console and I don’t know a way to silent that, but forcing a 0 exiting code it’s not a good idea.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript - npm throwing an error at the end of the eslint report
By design, eslint exits with status 1 if there are any linting errors. npm interprets this as an error, and it's telling you...
Read more >
NPM local server won't start. I am getting an error with ESLint
Failed at the react-redux-course@1.0.0 lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output ...
Read more >
eslint/eslint - Gitter
Hi, stage: lint in my CI pipeline fails with this error: Running ... npm ERR! frontend@0.1.0 lint: npm run lint:script && npm run...
Read more >
NPM — How to Run ESLint --fix From npm Script - Future Studio
NPM is a powerful package manager. It supports a scripts property in the package.json file. These scripts allow you to run commands for...
Read more >
Solved: NPM Error running
Please consider switching to eslint. ... [WARNING] npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found