javascriptreactjseslintpackage.jsontesting-library

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?


Solution

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