0

I tried to create a new react app using the command

npx create-react-app app-name

But I ended up getting this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: @babel/core@7.12.3
npm ERR! node_modules/@babel/core
npm ERR!   @babel/core@"7.12.3" from react-scripts@4.0.3
npm ERR!   node_modules/react-scripts
npm ERR!     react-scripts@"*" from the root project
npm ERR!   @babel/core@"^7.12.3" 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!   9 more (babel-jest, babel-loader, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @babel/core@"^7.13.0" from @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.13.12
npm ERR! node_modules/@babel/preset-env/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining
npm ERR!   @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@"^7.13.12" from @babel/preset-env@7.14.2
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! 
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.

I have tried out the command with both --force and --legacy-peer-deps but nothing seemed to workout.

Krishna
  • 35
  • 4
  • Try upgrading your nodejs version to latest or "node 14 LTS". – Ajeet Shah May 15 '21 at 03:43
  • I uninstalled everything and tried installing node 14 LTS but I ended up getting the following trouble : [link](https://stackoverflow.com/questions/67547811/node-looks-up-at-a-different-path) . Can you please help me out @AjeetShah ? – Krishna May 15 '21 at 14:36
  • I have just installed 14.17.1 and still get this error. Krishna have you solved this problem somehow? – Joerg Jun 22 '21 at 10:04
  • @Joerg I tried every which way but it didn't work. Since then I had to work on a different machine so I didn't get back to that issue. Please do let me know in case you figure out – Krishna Jun 22 '21 at 10:23

0 Answers0