Reputation: 87
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!
Upvotes: 4
Views: 2956
Reputation: 1
I faced the same issue ...what worked for me is :
Just use this command and press enter:
npm config set legacy-peer-deps true
then start creating your react app:
npx create-react-app your-app
cd your-app
npm start
-> npm install ajv@^8 ajv-keywords@^5
-> npm start
Upvotes: 0
Reputation: 1
This solved my issue. Maybe it will help somebody.
Installed React dependencies in my project using:
npm install react@latest react-dom@latest
Installed yarn
using:
npm install --global yarn
Followed by running:
yarn create react-app client --template typescript
Following command did not work for me at all:
npx create-react-app client --template typescript
After successful installation, I was able to go into the folder client
and launched the app by running npm start
.
Upvotes: 0
Reputation: 21
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.
Upvotes: 2