You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESLint is not running, error: "Cannot find module" #3998
npm ls react-scripts (if you haven’t ejected):
eslint-test@0.1.0 /Users/Joao/code/node/eslint-test
└── react-scripts@1.1.0
yarn eslint --version: v4.17.0
Node LTS, latest version of yarn
Then, specify:
Operating system: MacOS High Sierra 10.13.2
Browser and version (if relevant):
Steps to Reproduce
Run in terminal
create-react-app eslint-test
cd eslint-test/
yarn add eslint -D
Create file .eslintrc in project root
Add this content to the .eslintrc file:
{
"extends": "react-app"
}
Run yarn
Run yarn eslint src/App.js --debug
Expected Behavior
I though ESLINT would parse the file App.js
ESLint was supposed to work because I have followed the instructions on the documentation at "Displaying Lint Output in the Editor"
Actual Behavior
I'm getting the error Cannot find module 'eslint-config-react-app'
The output of yarn eslint src/App.js --debug:
The command npm ls eslint-config-react-app prints:
This issue was fixed running the command: yarn add -D eslint-config-react-app 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
This issue took quite a while to be resolved.
Should this command be documented at "Displaying Lint Output in the Editor" or "Troubeshoot"? Others could be facing the same problem.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.
Activity
gaearon commentedon Feb 9, 2018
Yeah I think our docs currently assume the dependency is being hoisted but Yarn probably doesn’t do this.
gaearon commentedon Feb 9, 2018
Maybe we could re-export the config as
react-scripts/eslintso we don’t need to rely on hoisting.jpaulomotta commentedon Feb 9, 2018
How could I help with this?
I read the source code of eslint-config-react-app but I don't know how this re-export could be made.
stale commentedon Nov 2, 2018
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.