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.

Sporadic failure calling ESLint - Error: ENOENT: no such file or directory, stat '[PROJECT_ROOT]/package.json'

See original GitHub issue

Tell 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
charvey77commented, May 27, 2020

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!

0reactions
eslint-deprecated[bot]commented, Jun 28, 2020

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: ENOENT: no such file or directory, stat ... .steampath
I've found out the solution. This error is just a fancy/convoluted missing dependencies message. If you install all the dependencies the ...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
eslintrc takes priority and the package.json file is not used. By default, ESLint looks for configuration files in all parent folders up to...
Read more >
no such file or directory, open '/opt/build/repo/package.json'
Our site builds in development, but fails in production. The error seems to be here: ENOENT: no such file or directory, ...
Read more >
eslint/eslint - Gitter
js project and having some issue with certan rule related to array. I have the following code in nuxt.config.js file: buildModules: [ '@nuxtjs/eslint-module', ......
Read more >
express error: enoent: no such file or directory, stat - You.com
ENOENT : no such file or directory, stat ERROR with Express Middleware ... and go to /file/blogRSS , it gives me this error:...
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