Himanshu Poddar
Himanshu Poddar

Reputation: 7789

ReactJS : Failed to load plugin 'testing-library' declared in 'package.json : Cannot find module './eslint-utils'

I recently made some copy pasting of code base from my one device to other device. I copied everything including the node modules folder. Now when I am running my react App I am getting error

npm start

Failed to load plugin 'testing-library' declared in 'package.json » eslint-config-react-app/jest': Cannot find module './eslint-utils'
Require stack:
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-plugin-testing-library\node_modules\@typescript-eslint\experimental-utils\dist\ast-utils\index.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-plugin-testing-library\node_modules\@typescript-eslint\experimental-utils\dist\index.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-plugin-testing-library\rules\await-async-query.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-plugin-testing-library\index.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\@eslint\eslintrc\lib\config-array-factory.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\@eslint\eslintrc\lib\index.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint\lib\cli-engine\cli-engine.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint\lib\cli-engine\index.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint\lib\api.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-webpack-plugin\dist\getESLint.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-webpack-plugin\dist\linter.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-webpack-plugin\dist\index.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\eslint-webpack-plugin\dist\cjs.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\react-scripts\config\webpack.config.js
- C:\Users\hpoddar\Desktop\WebDev\react-redux-demo\node_modules\react-scripts\scripts\start.js

So I tried to reinstall all my dependencies using npm install but that also didn't work. How do I resolve this?

Upvotes: 2

Views: 2911

Answers (3)

Nick F
Nick F

Reputation: 10122

In your particular case, I think the correct answer is to reinstall node_modules, as suggested in the accepted answer.

However, for anyone else who runs into this problem and finds this doesn't fix it, for me (having run into this issue inside VS Code after installing an ESLint plugin), the solution was to restart the ESLint server in VS Code (via the command palette).

Upvotes: 0

Rased Islam
Rased Islam

Reputation: 1

Before solve my code was:

<Link className="decoration" href="/" color="inherit">
                                Contact
                            </Link>

I change href:

<Link className="decoration" to="/" color="inherit">
                                Contact
                            </Link>

Upvotes: 0

Mario Beltr&#225;n
Mario Beltr&#225;n

Reputation: 581

If you copied everything including node modules, then try removing node modules and reinstall since copying that folder might cause issues.

Upvotes: 3

Related Questions