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.

Failed to load plugin 'react' declared in 'react1/.eslintrc.js': Cannot find module 'eslint-plugin-react'

See original GitHub issue

[Info - 7:07:59 PM] ESLint server stopped. [Info - 7:07:59 PM] ESLint server running in node v10.11.0 [Info - 7:08:00 PM] ESLint server is running. [Info - 7:08:00 PM] ESLint library loaded from: /Users/wubin02/work/react1/node_modules/eslint/lib/api.js [Error - 7:08:01 PM] Failed to load plugin ‘react’ declared in ‘react1/.eslintrc.js’: Cannot find module ‘eslint-plugin-react’ Require stack:

  • /Users/wubin02/work/placeholder.js Happened while validating /Users/wubin02/work/react1/src/test.js This can happen for a couple of reasons:
  1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
  2. If ESLint is installed globally, then make sure ‘eslint-plugin-react’ is installed globally as well.
  3. If ESLint is installed locally, then ‘eslint-plugin-react’ isn’t installed correctly.

Consider running eslint --debug /Users/wubin02/work/react1/src/test.js from a terminal to obtain a trace about the configuration files used.

but when I exec ./node_modules/.bin/eslint --debug /Users/wubin02/work/react1/src/test.js is ok; I tried many methods, finally I got a method , set workingDirectories as below:

{
	"folders": [
		{
			"path": "/Users/wubin02/work/react1"
		}
	],
	"settings": {}
}

if there are many projects , you can add extra path as below:

{
	"folders": [
		{
			"path": "/Users/wubin02/work/react1"
		},
               {
			"path": "/Users/wubin02/work/proj1"
		},
               {
			"path": "/Users/wubin02/work/proj2"
		}
	],
	"settings": {}
}

is there any solution ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
sprietNathanaelcommented, Sep 25, 2019

@dbaeumer Oh, I think I found my problem: my workspace contains both my server and my client, with a eslintrc.json for each. When I open VsCode with only my client, it works fine. Adding both folders to my workspace as multiple roots works too. So, sorry but I think my issue is not related to the original one, but thanks for leading me to the solution!

10reactions
nikolay-borzovcommented, Sep 30, 2019

Specifying working directory solved the problem for me

"eslint.workingDirectories": [
  "client"
]
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing with "Failed to load plugin 'react' declared in '.eslintrc'
jsx This can happen for a couple of reasons: 1. The plugin name is spelled incorrectly in an ESLint configuration file (e. ......
Read more >
Dealing with "Failed to load plugin 'react' declared in '.eslintrc'
[Solved]-Dealing with "Failed to load plugin 'react' declared in '.eslintrc': Cannot find module 'eslint-plugin-react'" ESLint error-Reactjs.
Read more >
eslint/eslint - Gitter
Failed to load plugin 'react' declared in 'project-igi/.eslintrc.js': Cannot find module 'eslint-plugin-react' This can happen for a couple of ...
Read more >
cannot find module 'eslint-plugin-import' vscode
Consider running eslint --debug /Users/wubin02/work/react1/src/test.js from a terminal to obtain ... Failed to load plugin eslint-react: Cannot find module ...
Read more >
[eslint] failed to load plugin 'prettier' declared in '.eslintrc.json'
VSCode failed to load plugin cannot find module 'eslint-plugin-prettier' ... related issue: create-react-app subfolder projects do not lint. Open side panel.
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