Running eslint as an npm script results in ELIFECYCLE error.
See original GitHub issueI’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:
- Created 8 years ago
- Reactions:1
- Comments:17 (3 by maintainers)
Top GitHub Comments
eslint ...; exit 0
?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.