While Creating React Project - Dependency Resolution Issue
The error occurred while running npx create-react-app my-app. The installation process failed due to an "ERESOLVE unable to resolve dependency tree" issue.
The latest create-react-app (CRA) installs React 19 by default, but @testing-library/[email protected] has a peer dependency requirement of React ^18.0.0, causing dependency conflicts. Using --template minimal resolves this issue as it creates a project without testing libraries, avoiding the version mismatch between React 19 and testing dependencies.
Workaround:
Use npx create-react-app cra --template minimal to create a project without testing dependencies.
no matching version found for @babel/plugin-transform-for-of@^7.26.9 =(
and minimal template not working
need some refactoring
import React from 'react';
// import ReactDOM from 'react-dom';
import App from './App';
import { createRoot } from 'react-dom/client';
// ReactDOM.render(
// <React.StrictMode>
// <App />
// </React.StrictMode>,
// document.getElementById('root')
// );
const domNode = document.getElementById('root');
const root = createRoot(domNode);
root.render(<React.StrictMode><App /></React.StrictMode>);
Please read docs CRA is deprecated
Create React App was one of the key tools for getting a React project up-and-running in 2017-2021, it is now in long-term stasis and we recommend that you migrate to one of React frameworks documented on Start a New React Project.