-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"ESLint: Error while loading rule 'react/display-name': Cannot find module 'react' from '/home/...'. #2346
Comments
are you on eslint 5 or 6? eslint 6 made some changes that tend to force standard configurations. |
I'm using 5.16.0 |
Can you explain a bit about your project layout, including where package.json and your eslint config lives, and where you ran the eslint command? |
@sgehrman, I faced the same today. The cause was a corrupted |
I am facing the same issue as OP (using eslint 5.16.0), downgrading to 7.11.1 worked for me as well. |
As for myself, downgrading to |
It seems the error is being caused by this commit specifically golopot@bdd61922d373f71d8 |
@ljharb any info on when a new release containing that fix will be published? |
@michaellopez I just published |
I just remove and reinstall, problem solved. my version is
|
I just ran into this with the latest version. I tried (1) restarting VSCode and (2) deleting node_modules and re-running (Perhaps the issue is caused by trying to run eslint with a much newer version than it was previously run. Maybe you need to run with a somewhat newer version before just suddenly upgrading to the latest version like a crazy person. I'm sorry, I'm just making this up. I have no idea 🤷♂️🤷♂️🤷♂️.) |
@devuxer you should be able to upgrade to latest eslint 7 just fine. upgrading to eslint 8 might be trickier. |
This version works:
"eslint-plugin-react": "7.11.1",
But new versions are broken. My project is a bit non standard. We have the package.json inside the source folder, so it seems the new versions don't find it in this case, but it has worked fine when using 7.11.1
The text was updated successfully, but these errors were encountered: