You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to Create a New React App Using npx create-react-app #13776
I've been facing issues when creating a new React app using the npx create-react-app command for the past 1 1.5 months. Despite trying multiple solutions, the problem persists, making it impossible to set up a new React project.
Steps to Reproduce
Run the command: npx create-react-app my-app.
Attempted the following flags to bypass errors:
--force
--legacy-peer-deps
Tried on different systems and environments:
Operating Systems: Windows 10/11, macOS
Networks: Airtel and BSNL ISPs
Tested on various Node.js versions (all managed with NVM):
16.x (LTS)
18.x (LTS)
20.x (LTS)
22.x (LTS)
Expected Behavior
After running the npx create-react-app command, a new React app should be successfully created.
Actual Behavior
The command fails to complete successfully. I've attached screenshots of the errors encountered below for you to look over.
Attempts to Fix
Used --force and --legacy-peer-deps flags.
Tried different versions of Node.js.
Tested on different operating systems and networks.
Environment
OS: Windows 10/11, macOS
Node.js: 16, 18, 20, and 22 (LTS versions)
NPM: Latest version (installed with Node.js)
React: The npx create-react-app version is the default fetched by NPM.
Attachments
(Screenshots of the error messages)
Additional Information
This issue has persisted across multiple environments and configurations for over a month. Please let me know if further details or debugging information are needed to assist in resolving this issue.
Still reproducible with node 23.5.0 (via nvm, OS: Windows 11) as well:
Installing template dependencies using npm...
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: my-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.
npm error
npm error
npm error For a full report see:
npm error C:\Users\xxx\AppData\Local\npm-cache\_logs\2025-01-01T14_37_00_042Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\xxx\AppData\Local\npm-cache\_logs\2025-01-01T14_37_00_042Z-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 gotta say I'd prefer if this 'hello world' program didn't track and report users' behaviour with web-vitals. Someone using this is trying out react, not signing up to report anybody's activity.
@tabax I found no official documentation supporting your words on the official create-react-app repository, and official react documentation. Even the official reaction.dev documentation is for Next.js and also suggests using npx create-next-app@latest to create a new next app, though we are talking about React.js, not Next.js. See: https://react.dev/learn/start-a-new-react-project
@itsRkator There are a bunch of solutions available out there for this issue. React is coming with major v19 but peers are expecting react to be in v18 and hence the issues.
After the error comes up cd inside the project and install the latest version of peers which will depend on v19 of react and the issue will be resolved.
This is indeed all very confusing.
The reactjs react.dev repo says create-react-app is dead. After using create-react-app and running for the first time, one is presented with the message "babel-preset-react-app is part of the create-react-app project, which is not maintianed anymore." [sic]
However https://github.com/facebook/create-react-app/ has no mention of this, nor does the website.
Anyway, the React website does give other options.
If you still want to, npx yarn create react-app xxx seems to be working.
I've been using this for years in educational examples but now it's time to move on.
So people, stop wasting your precious time with this unmaintained project. This error has been reported for weeks already.
At least give a chance to other projects like Vite, which work, are maintained, and have amazing documentation and community support.
Here is what you need to get started:
npm create vite@latest my-app -- --template react
It's almost the same setup that this tool creates, with the only minor disadvantage that you need to set up tests afterward. But this can also be solved in just 2-3 minutes by following a tutorial.
Reacted by Nikolay Anikevich, Valentin Despa and wensiqun
For now, I found a temporary solution to fix this issue. Use CRA's default command and then cd into the project and install the latest versions of web-vitals and testing-library/react dependencies using npm install @testing-library/react@latest web-vitals@latest. As @anipnwr7777 suggested, the peers expect different versions, and the CRA installed the newest version of React. Hence, we must get the latest versions of the other dependencies mentioned in the error message.
Still reproducible with node 23.5.0 (via nvm, OS: Windows 11) as well:
Installing template dependencies using npm...
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: my-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.
npm error
npm error
npm error For a full report see:
npm error C:\Users\xxx\AppData\Local\npm-cache\_logs\2025-01-01T14_37_00_042Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\xxx\AppData\Local\npm-cache\_logs\2025-01-01T14_37_00_042Z-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 had Resolve the issue..
I had overcome this issue, i had used many ways and technique but i doesn't work. Here's how, I resolve the issue_
First you need to remove all the npm caches etc then use this commands one by one..
"npm create vite@latest my-app -- --template react
cd my-app
npm install
npm run dev
"
After running the last command, will see "http://localhost:3000/" You can access it just copy it and run on the browser then start developing..
I'm hopping that this would works f fine. If yes please to forgot to tell me or please follow me for more....
On February 14, 2025, the React team officially deprecated Create React App (CRA) for new projects. Since its launch in 2016, CRA has helped developers quickly set up React applications without complex configurations.
↗️ Why is CRA being deprecated?
With the rise of modern build tools like Next.js, Vite, Parcel, and RS Build, CRA has become outdated and lacks active maintenance.
↗️ What does this mean for developers?
Installing CRA now triggers a deprecation warning.
Existing CRA projects will continue to function but will remain in maintenance mode.
The React team recommends migrating to a modern framework for better performance and scalability.
↗️ What's next?
✔ Use Next.js, Vite, or another modern framework for new projects.
✔ Follow migration guides from Next.js, React Router, and Expo to transition existing apps.
Activity
lakpahana commentedon Dec 30, 2024
Could you please attach the log files as well? That would be very helpful.
Thank you!
Nithesh0812 commentedon Dec 30, 2024
try this command "npx create-react-app@latest react-18-20-5"
itsRkator commentedon Dec 31, 2024
@Nithesh0812 This also didn't work.
@lakpahana Here are the files:
2024-12-31T01_45_25_149Z-debug-0.log
2024-12-31T01_45_25_149Z-eresolve-report.txt
jesobreira commentedon Dec 31, 2024
Same issue here. Windows and Ubuntu.
Using
--legacy-peer-depshere makes CRA complete, but runningnpm startfails:Ting-Ching-Chou commentedon Dec 31, 2024
Same issues are found in TypeScript template.
tabax commentedon Jan 1, 2025
Still reproducible with node 23.5.0 (via nvm, OS: Windows 11) as well:
tabax commentedon Jan 1, 2025
This is an unmaintained project (see: reactjs/react.dev#5487).
tonydiep commentedon Jan 2, 2025
create-react-app does not create a working react app for me either in Ubuntu 24.04
npm start does start but displays page with error message
tonydiep commentedon Jan 2, 2025
Here's what resolves it:
I gotta say I'd prefer if this 'hello world' program didn't track and report users' behaviour with web-vitals. Someone using this is trying out react, not signing up to report anybody's activity.
itsRkator commentedon Jan 2, 2025
@tabax I found no official documentation supporting your words on the official create-react-app repository, and official react documentation. Even the official reaction.dev documentation is for
Next.jsand also suggests usingnpx create-next-app@latestto create a new next app, though we are talking about React.js, not Next.js. See: https://react.dev/learn/start-a-new-react-projectanipnwr7777 commentedon Jan 3, 2025
@itsRkator There are a bunch of solutions available out there for this issue. React is coming with major v19 but peers are expecting react to be in v18 and hence the issues.
After the error comes up
cdinside the project and install the latest version of peers which will depend on v19 of react and the issue will be resolved.npm install @testing-library/jest-dom@latest @testing-library/react@latest @testing-library/user-event@latest web-vitals@latestafter this
npm startshould fix the issue.kwikwag commentedon Jan 3, 2025
This is indeed all very confusing.
The reactjs react.dev repo says create-react-app is dead.
After using create-react-app and running for the first time, one is presented with the message "babel-preset-react-app is part of the create-react-app project, which is not maintianed anymore." [sic]
However https://github.com/facebook/create-react-app/ has no mention of this, nor does the website.
Anyway, the React website does give other options.
If you still want to,
npx yarn create react-app xxxseems to be working.vdespa commentedon Jan 4, 2025
I've been using this for years in educational examples but now it's time to move on.
So people, stop wasting your precious time with this unmaintained project. This error has been reported for weeks already.
At least give a chance to other projects like Vite, which work, are maintained, and have amazing documentation and community support.
Here is what you need to get started:
It's almost the same setup that this tool creates, with the only minor disadvantage that you need to set up tests afterward. But this can also be solved in just 2-3 minutes by following a tutorial.
itsRkator commentedon Jan 6, 2025
For now, I found a temporary solution to fix this issue. Use CRA's default command and then
cdinto the project and install the latest versions ofweb-vitalsandtesting-library/reactdependencies usingnpm install @testing-library/react@latest web-vitals@latest. As @anipnwr7777 suggested, the peers expect different versions, and the CRA installed the newest version of React. Hence, we must get the latest versions of the other dependencies mentioned in the error message.Ismailkh356 commentedon Jan 9, 2025
I had Resolve the issue..
I had overcome this issue, i had used many ways and technique but i doesn't work.
Here's how, I resolve the issue_
First you need to remove all the npm caches etc then use this commands one by one..
"npm create vite@latest my-app -- --template react
cd my-app
npm install
npm run dev
"
After running the last command, will see "http://localhost:3000/" You can access it just copy it and run on the browser then start developing..
I'm hopping that this would works f fine. If yes please to forgot to tell me or please follow me for more....
carreyda commentedon Jan 23, 2025
I have encountered the same problem. Is there a successful solution?
itsRkator commentedon Feb 22, 2025
Create React App is Officially Deprecated 🚨
On February 14, 2025, the React team officially deprecated Create React App (CRA) for new projects. Since its launch in 2016, CRA has helped developers quickly set up React applications without complex configurations.
With the rise of modern build tools like Next.js, Vite, Parcel, and RS Build, CRA has become outdated and lacks active maintenance.
Installing CRA now triggers a deprecation warning.
Existing CRA projects will continue to function but will remain in maintenance mode.
The React team recommends migrating to a modern framework for better performance and scalability.
✔ Use Next.js, Vite, or another modern framework for new projects.
✔ Follow migration guides from Next.js, React Router, and Expo to transition existing apps.
https://react.dev/blog/2025/02/14/sunsetting-create-react-app