Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm unable to install template dependencies

I am currently trying to create-react-app with --template typescript but I am getting the following error:

Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"<18.0.0" from @testing-library/[email protected]
npm ERR! node_modules/@testing-library/react
npm ERR!   @testing-library/react@"^12.0.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 /Users/BrianKim/.npm/eresolve-report.txt for a full report.

I've tried updating npm as well as node, but cannot get create-react-app to work at all. Please let me know what I could do, thanks!

like image 859
hematopoietic Avatar asked Oct 24 '25 02:10

hematopoietic


1 Answers

I just installed "yarn" using "npm install --global yarn" and after that I installed react using "yarn create react-app my-app --template typescript" and everything worked fine for me without errors.

like image 79
Егор Броцман Avatar answered Oct 26 '25 16:10

Егор Броцман