M220JS npm install not working

I am still in the Chapter 0: Introduction and Setup

Ticket: Connection

Running npm install throws an error

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-config-react-app@2.1.0
npm ERR! Found: babel-eslint@9.0.0
npm ERR! node_modules/babel-eslint
npm ERR!   babel-eslint@"^9.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer babel-eslint@"^7.2.3" from eslint-config-react-app@2.1.0
npm ERR! node_modules/eslint-config-react-app
npm ERR!   eslint-config-react-app@"^2.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: babel-eslint@7.2.3
npm ERR! node_modules/babel-eslint
npm ERR!   peer babel-eslint@"^7.2.3" from eslint-config-react-app@2.1.0
npm ERR!   node_modules/eslint-config-react-app
npm ERR!     eslint-config-react-app@"^2.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Cardano\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Cardano\AppData\Local\npm-cache\_logs\2022-07-01T21_06_52_689Z-debug-0.log
1 Like

Hi @Jalal_Mirzayev,
Can you please delete the:

  • package-lock.json file
  • node_modules folder

After that, run the install command using the --legacy-peer-deps flag as below:

npm install --legacy-peer-deps

And then, run the development server with the following command:

npm start

And hopefully, it will fix the issue.

If you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
MongoDB

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.