[SOLUTION]:ERESOLVE unable to resolve dependency tree

Parag Varshney
2 min readMay 24, 2021

--

If you are getting such error while using

npx create-react-app app-name

Creating a new React app in /home/parag/react-tutorial/internshala-react-course/chat-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! npm ERR! Found: @babel/core@undefined
npm ERR! node_modules/@babel/core npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.0.0-0" from @babel/preset-env@7.13.10
npm ERR! node_modules/@babel/preset-env
npm ERR! @babel/preset-env@"^7.12.1" from @svgr/webpack@5.5.0
npm ERR! node_modules/@svgr/webpack
npm ERR! @svgr/webpack@"5.5.0" from react-scripts@4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"*" 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 /home/parag/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/parag/.npm/_logs/2021-03-18T11_58_50_255Z-debug.log

Aborting installation. npm install --save --save-exact --loglevel
error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting chat-app/ from /home/parag/react-tutorial/internshala-react-course
Done.

so here is the solution for that use

npm init react-app app-name

After using this if you use npx create-react-app app-name command above it will work perfectly .I don’t know why this is happening but I find it today so thought I should write it may be it can help others or me some other day.

Thanks

--

--