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:
- The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
- If ESLint is installed globally, then make sure ‘eslint-plugin-react’ is installed globally as well.
- 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:
- Created 4 years ago
- Comments:17 (3 by maintainers)
Top GitHub Comments
@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!Specifying working directory solved the problem for me