Closed
Description
When create a new project says:
npx create-react-app app
Creating a new React app in /.../app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1319 packages in 8s
264 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: app@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.
The main react script for create a new project use the @testing-library/react
using a old version an cause a conflict with the main package.
Please, upgrade the react package from 18 to 19.
For more information see the apocalypse post from react scripts repository:
- Error from using npx create-react-app facebook/create-react-app#13721
- can not create-react-app facebook/create-react-app#13727
- Bug: creation reactjs new project latest so v19 facebook/react#31701
- create-react-app installs react@19.0.0 causing peer dependency facebook/create-react-app#13717
- npx create-react-app facebook/create-react-app#13716
- Having Issue will creating react app facebook/create-react-app#13715
- https://www.reddit.com/r/react/comments/1h8f2ul/new_to_react_problem_running_createreactproject/
- And more...
Symilar issue 2 years ago when react upgrade to 18:
- https://stackoverflow.com/questions/71838873/create-react-app-throwing-errors-unable-to-resolve-dependency-tree-and-fix-up
- Issue while trying to create new project facebook/create-react-app#12279
Please be more careful with the versions so that the react project builder doesn't break every time they are updated.
Metadata
Metadata
Assignees
Labels
No labels