Sporadic failure calling ESLint - Error: ENOENT: no such file or directory, stat '[PROJECT_ROOT]/package.json'
See original GitHub issueTell us about your environment
- ESLint Version: 5.4.0
- Node Version: 10.16.2
- npm Version: 6.9.0
What parser (default, Babel-ESLint, etc.) are you using? default parser
Please show your full configuration:
Configuration
{
"extends": "semistandard",
"env": {
"amd": true,
"jasmine": true,
"qunit": true
},
"globals": {
"F": "readonly"
},
"rules": {
"indent": ["warn", 4, {"SwitchCase": 1}]
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
// no relevant source code
Node.js/bin/node /build_harness/1.0.2/node_modules/eslint/bin/eslint.js --config /build_harness/1.0.2/node_modules/eslint-config-custom/eslintrc.json [PROJECT_ROOT]/js_src/*.js
What did you expect to happen? ESLint command would parse the specified JavaScript files correctly
What actually happened? Please include the actual, raw output from ESLint.
For some background, we have a setup where we use Makefiles to call Node.js to invoke ESLint. We see the following error only sporadically. Most of the time, ESLint works as expected.
What I think should be happening is that the package.json that is referenced in the error below should be found here: build_harness/1.0.2/node_modules/eslint-config-custom/
not in: [PROJECT_ROOT]
It feels like some ESLint configuration is getting modified, but I’m not sure how to debug that kind of behavior. Any insights would be most appreciated.
Error: ENOENT: no such file or directory, stat ‘[PROJECT_ROOT]/package.json’ at Object.statSync (fs.js:855:3) at entries.forEach.entry (/build_harness/1.0.2/node_modules/eslint/lib/util/file-finder.js:49:20) at Array.forEach (<anonymous>) at normalizeDirectoryEntries (/build_harness/1.0.2/node_modules/eslint/lib/util/file-finder.js:45:13) at FileFinder.findAllInDirectoryAndParents (/build_harness/1.0.2/node_modules/eslint/lib/util/file-finder.js:106:30) at findAllInDirectoryAndParents.next (<anonymous>) at Config.getLocalConfigHierarchy (/build_harness/1.0.2/node_modules/eslint/lib/config.js:220:20) at Config.getConfigHierarchy (/build_harness/1.0.2/node_modules/eslint/lib/config.js:192:43) at Config.getConfigVector (/build_harness/1.0.2/node_modules/eslint/lib/config.js:299:21) at Config.getConfig (/build_harness/1.0.2/node_modules/eslint/lib/config.js:342:29)
Are you willing to submit a pull request to fix this bug? No
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
A quick update: I have gotten approval to update our internal version to 6.8.0. I’m qualifying our changes to see if this clears up the issue I originally reported. I’ll will follow up once I have a good sample size of builds using the latest version, and how they respond to the latest ESLint version.
Thanks again for all of the feedback here! Be in touch soon!
It looks like the conversation is stalled here. As this is a question rather than an action item, I’m closing the issue. If you still need help, please send a message to our mailing list or chatroom. Thanks! [//]: # (auto-close)