react: Bug: creation reactjs new project latest so v19
React version:19.0.0
Steps To Reproduce
1.npx create-react-app module 2. wait
Link to code example:
The current behavior
Creating a new React app in /…/module
Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template…
added 1315 packages in 10m
261 packages are looking for funding
run npm fund for details
Initialized a git repository.
Installing template dependencies using npm… npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error npm error While resolving: module_loginweb_reactjs@0.1.0 npm error Found: react@19.0.0 npm error node_modules/react npm error react@“^19.0.0” from the root project npm error npm error Could not resolve dependency: npm error peer react@“^18.0.0” from @testing-library/react@13.4.0 npm error node_modules/@testing-library/react npm error @testing-library/react@“^13.0.0” from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error /…/.npm/_logs/2024-12-08T06_26_18_730Z-eresolve-report.txt npm error A complete log of this run can be found in: …
The expected behavior
no error
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 6
- Comments: 31
Why is this issue marked as closed? Using yarn instead of npx is not an excuse for fixing this bug
This is not a solution. Definitely not.
The official documentation recommends
npx create-react-app my-appas the way to create a project. And that is not working anymore. It seams to me that we have a major bug.Use: npm config set legacy-peer-deps true
I got this from https://www.youtube.com/watch?v=glM8CBthVVg and is working for me now.
I solved that by : yarn create react-app module
my story is that I ran
npm install ajv --save-devthen a bulk update for everythying
npx npm-check-updates -uPLUSnpm installand with another
npm start…magically, everything was resolved and wrked so fine! now, ready for the next battle 😄
Guys I use this trick to fix this issue:
npx create-react-app . npm uninstall react react-dom npm install react@18.2.0 react-dom@18.2.0 npm install --legacy-peer-deps npm install web-vitals
The issue has solved finally. thank you very much.

Did not solve
npx create-react-app app_namebut manually changing the@testing-library/reactto version16.1.0works for me. Seems like it’s the compatible version with react 19rm -rf node_modules package-lock.jsonnpm installno errors on this
Completely new to React and facing the same issue now, and this just work for me!
I have been facing the same issue for the last two weeks. React v19 is making the process of creating a React app difficult and frustrating. I wonder what new learners must be going through.
I wanted to create-react-app with typescript template and RTL but ran into this same issue.
Had to install RTL manually with types using command :
npm install --save-dev @testing-library/react @testing-library/dom @testing-library/jest-dom @testing-library/user-event @types/react @types/react-dom @types/jest @types/node --legacy-peer-deps