I stopped practicing react for a few months and recently when i picked it up again, i was not able to even create a react app properly. There is a dependency conflict.
These are the errors whenever i ran the “npx create-react-app appname” command:
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
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/[email protected]
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 C:UserschiraAppDataLocalnpm-cache_logs2024-12-17T19_27_59_239Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:UserschiraAppDataLocalnpm-cache_logs2024-12-17T19_27_59_239Z-debug-0.log
npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^13.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0
failed
I’ve tried:
- Downgrading react
- Completely reinstalling react
- Repairing node
This is also interfering with my mongodb installation
What else can i do?
2
I think it’s because React has just updated to v19 last week and testing-library/react hasn’t updated their dependency requirements yet.
In 2024, I would suggest creating a new React App using Vite. Try running this
npm create vite@latest