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.

Cannot find module 'eslint-config-react-app'

See original GitHub issue

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Didn’t try 4. I’m using lts/carbon with yarn.

Which terms did you search for in User Guide?

I looked through the user guide and found Usage in Create React App Projects which indicates that it should be available as part of Create React App.

Environment

  1. node -v: 8.9.3
  2. npm -v: 5.5.1
  3. yarn --version (if you use Yarn): 1.3.2
  4. npm ls react-scripts (if you haven’t ejected): 1.0.17

Then, specify:

  1. Operating system: macOS 10.12.6
  2. Browser and version (if relevant): Chrome/N/A

Steps to Reproduce

(Write your steps here:)

  1. create-react-app eslint-dep
  2. cd eslint-dep
  3. yarn global add eslint
  4. echo '{"extends": "react-app"}' > .eslintrc
  5. eslint src

Expected Behavior

I thought I’d have all the necessary eslint plugins to run eslint src with the react-app plugin.

Actual Behavior

Cannot find module 'eslint-config-react-app'
Referenced from: /Users/typeoneerror/Dev/eslint-bug/.eslintrc.json
Error: Cannot find module 'eslint-config-react-app'

This may be simply a dependency issue, but it may be a documentation issue as the eslint-config-react-app package says I should have this already as part of CRA.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
lorensrcommented, Jan 30, 2018

For anyone else trying this, one solution is installing eslint-config-react-app globally, along with all of its peer deps. At the moment, that’s:

npm i -g babel-eslint@^7.2.3 eslint@^4.1.1 eslint-plugin-flowtype@^2.34.1 eslint-plugin-import@^2.6.0 eslint-plugin-jsx-a11y@^5.1.1 eslint-plugin-react@^7.1.0
5reactions
fmaiabatistacommented, Jul 2, 2018

You have to have the ‘eslint-config-react-app’ package in the same “scope” of your eslint installation. If you installed eslint globally (by using ‘npm install -g eslint’ or ‘yarn global add eslint’) you should do the same for “eslint-config-react-app”… if you installed locally (npm without -g or yarn without global), you should install the config package in the same way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint in terminal Cannot find module 'eslint-config-react-app'
the linter works in create-react-app but now i want make it work in my sublimetext. Installed eslint yarn global add eslint (eslint v4.1.1...
Read more >
eslint-config-react-app - npm
ESLint configuration used by Create React App. Latest version: 7.0.1 ... Start using eslint-config-react-app in your project by running `npm ...
Read more >
Using globally installed "standard" package causes "Cannot ...
Using globally installed "standard" package causes "Cannot find module 'eslint-plugin-react'" error · npm install standard@14.3.1 -g · create a new project, ...
Read more >
eslint-config-react-app - npm package - Snyk
The npm package eslint-config-react-app was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >
eslint couldn't find the config "react-app" to extend from
If ESLint is not able to find the react-app config, there are likely conflicting or duplicate ESLint config dependencies that were installed outside...
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