2

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?

1
  • Could you share your package.json please? What message did you get when running npm install? Commented Nov 6, 2021 at 10:31

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

but I tried runnig npm install again, why didn't that fix the issue?
I’m not sure if that fixes the dependencies references. Better to nuke the node_modules and do a fresh install.
0

Before solve my code was:

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

I change href:

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

1 Comment

0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.