Installing template dependencies using npm:
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
Consider switching to Vite.
Here's how to set up a new React project using Vite:
# Create new Vite project
npm create vite@latest my-react-app
# Navigate to project directory
cd my-react-app
# Install dependencies
npm install
# Start dev server
npm run dev
https://github.com/facebook/create-react-app/issues/13717#issuecomment-2537222504
React v19 has an issue while installing @testing-library/react. To temporarily resolve this dependency issue, you can set legacy-peer-deps flag to true so that it resolves the peer dependency conflicts. You can do this by running:
npm config set legacy-peer-deps true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With