create-react-app: npx create-react-app is not working
$ npx create-react-app my-app
You are running create-react-app
4.0.0, which is behind the latest release (4.0.1).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here: https://create-react-app.dev/docs/getting-started/
npm ERR! code 1 npm ERR! path C:\Users\User\Desktop npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-react-app my-app
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Local\npm-cache_logs\2020-11-23T18_27_48_723Z-debug.log
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 47
- Comments: 100
I solved this using the following command.
npm uninstall -g create-react-app
then
npm install -g create-react-app
I am able to solve the problem by first trying to uninstall the npm globally, update the npm, clear the cache then using npx command to create React app.
The command is as below:
npm uninstall -g create-react-app && npm i -g npm@latest && sudo npm cache clean -f && npx create-react-app my-app
This is taken from one of the Stack Overflow posts.
https://stackoverflow.com/questions/64963796/create-react-app-is-not-working-since-version-4-0-1/65043610
It’s not working for me. Please help me!😢 Again I saw this error----
npm ERR! code ENOENT npm ERR! syscall open npm ERR! path D:\udemy/package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open ‘D:\udemy\package.json’ npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Local\npm-cache_logs\2020-11-30T20_18_36_036Z-debug.log
npm init -y npx create-react-app project1
================================== First Time -> I Found Error (Use Git Bash)
$ npx create-react-app test
Creating a new React app in C:\React_TEE\test.
Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template…
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: type-fest@0.11.0 npm ERR! node_modules/type-fest npm ERR! type-fest@“^0.11.0” from ansi-escapes@4.3.1 npm ERR! node_modules/ansi-escapes npm ERR! ansi-escapes@“^4.3.1” from jest-watch-typeahead@0.6.1 npm ERR! node_modules/jest-watch-typeahead npm ERR! jest-watch-typeahead@“0.6.1” from react-scripts@4.0.1 npm ERR! node_modules/react-scripts npm ERR! react-scripts@“" from the root project npm ERR! ansi-escapes@“^4.2.1” from @jest/core@26.6.3 npm ERR! node_modules/@jest/core npm ERR! @jest/core@“^26.6.0” from jest@26.6.0 npm ERR! node_modules/jest npm ERR! jest@“26.6.0” from react-scripts@4.0.1 npm ERR! node_modules/react-scripts npm ERR! 1 more (jest-watch-typeahead) npm ERR! 1 more (jest-cli) npm ERR! 2 more (jest-watcher, terminal-link) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional type-fest@“^0.13.1” from @pmmmwh/react-refresh-webpack-plu gin@0.4.2 npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin npm ERR! @pmmmwh/react-refresh-webpack-plugin@“0.4.2” from react-scripts@4.0.1 npm ERR! node_modules/react-scripts npm ERR! react-scripts@"” from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:\Users\Miku\AppData\Local\npm-cache\eresolve-report.txt for a ful l report.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Miku\AppData\Local\npm-cache_logs\2021-01-29T19_19_32_095 Z-debug.log
Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file… package.json Deleting test/ from C:\React_TEE Done. npm ERR! code 1 npm ERR! path C:\React_TEE npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-react-app test
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Miku\AppData\Local\npm-cache_logs\2021-01-29T19_19_32_148 Z-debug.log
================================== I Fix Error (Use Git Bash)
npm uninstall create-react-app npm uninstall -g create-react-app npm i -g npm@latest npm cache clean -f npx create-react-app my-app . . . Happy hacking!
I had the same error and the solution for me was to remove the npm cache folder: https://docs.npmjs.com/cli/v6/configuring-npm/folders#cache
This worked for me too, however, I went into
~/.npm/_npx/<cache hash>/node_modules
and deleted thecreate-react-app
directory specifically. Then, just to be very sure, I also manually edited~/.npm/_npx/<cache hash>/package.json
and set the version for create-react-app to 4.0.1, even though it was marked with a carrot already.Then I ran
npx create-react-app ...
again, it prompted to install it, hit “y”, and I was back in business.“npx create-react-app my-app” instead of “npm install -g create-react-app”
This did the trick for me. Thanks!
**npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /Users/reach/Documents/Personal Projects/Service_Project/iCareerZ/package.json npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open ‘/Users/reach/Documents/Personal Projects/Service_Project/iCareerZ/package.json’ npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR! /Users/reach/.npmrc/_logs/2020-12-02T01_50_49_350Z-debug.log**
I also got the same problem. I try “npx create-react-app my-app” and it seems like not working. Please help
For me I got the same error even though
create-react-app
was installed in a parent directory, not globally. So I rannpm uninstall create-react-app
without the-g
flag and it worked.This worked for me. Thank you very much @reach009
Worked for me as well, thank you.
I have never had create-react-app installed and still receive this error. In fact, I have no npm packages installed at all, but it still warns that I am running 4.0.0, and that global installation is no longer supported, and then exits.
node 14.15.0, have tried clearing the npm cache.
Try this
npx create-react-app@latest your-project-name --use-npm
it works for menpx create-react-app@latest your-project-name --use-npm
really works (https://stackoverflow.com/a/65185822/11821819)If you’re having trouble and don’t want to waste more time, remove the entire npx cache for the current user (on linux/mac it’s usually achieved by this command:
rm -rf ~/.npm/_npx
).You can find the root npm cache directory path (that contains
_npx
directory) by using:npm config get cache
I’ve also run into the same problem as others above and have been going around in circles for 2 hours. My steps: ‘npm uninstall -g create-react-app’ (even though I never installed create-react-app globally), ‘npm cache clean --force’ (I also tried ‘sudo npm cache clean -f’) then ‘npx create-react-app my-app.’
Yet, I’m still running an error that I have it globally installed: You are running create-react-app 4.0.0, which is behind the latest release (4.0.1). We no longer support global installation of Create React App.
I’m at a loss and stuck in what feels like a maze. My next step is to manually start deleting and files as baalansellers suggests, but I don’t think that should be necessary.
Thanks for this! Worked for me too.
I’ll add that
npx create-react-app@latest your-project-name
did the trick for me. Didn’t need the--use-npm
flag.If npx create-react-app is not working then do this
npm uninstall -g create-react-app npm install -g create-react-app npx create-react-app my-app cd my-app npm start
you sir are a legend i swear
reach009 thnks
Use a different network: For example, you can try connecting to a different Wi-Fi network or using a mobile hotspot.
Hope this should help you.This Works For me.
This finally worked for me
Thanks all of you for your contribution 👍🤗
I happened to stumble upon this error in the LTS version. Solved the issue by updating the create-react-app to the latest 4.0.3. npm i create-react-app@latest. Hooray! everything goes well afterwards.
I solved this using the following command.
npm uninstall -g create-react-app
npm cache clean --force
then
npx create-react-app project_name --template all
Thanks for this! Worked for me too.
I don’t know about this one, but after installing
npm i -g yarn
and then that’s the time I started building project usingnpx create-react-app my_app
It works for me. Oh update npm.Best Solution, work for me, try this one.
hi, i have try everything here, but nothing work for me 😦 i have a vps running with debian 11, any idea?
This is the cleanest solution that worked for me, thanks @gurjeetsinghvirdee
Thanks for sharing!!!
I have had this issue on
node v14
on Mac OS. Runningnpm uninstall -g create-react-app
and then usingnpx
would still give the messageA template was not provided. This is likely because you're using an outdated version of create-react-app.
I resolved it by following the steps here: https://github.com/facebook/create-react-app/issues/8097
Adding here in case it helps someone.
Just a heads up, one more think I had to do on Mac was remove
package.json
from my~/.npm/_npx
folder. For some reason, there was apackage.json
in there that just saidOnce I deleted that file I was able to run
npx create-react-app my-app
no problem.Hope this helps someone!
I have the same problem, to add more info, in windows 7, the latest version for node supported its 13.6.0 and since create-react-app needs node 14, we can not run this command.
is there any workaround about this? tried ->
npx create-react-app@4.0.3 web --template typescript
, but doesn’t work eitherThe “bundled” command below worked for me today (5/11/21). Thanks so much!
npm uninstall -g create-react-app && npm i -g npm@latest && sudo npm cache clean -f && npx create-react-app
worked for me as well
So let me get this straight, the solution to the problem is to do the very thing npm told you not to do anymore?
I tried all these things and nothing was working.
Then I did
npm list
and realized I had a roguenode_modules/
andpackage.json
in my parent folder which hosts all my projects. (A result of some carelessnpm
ing ) 🤦Removing that solved it all. Good luck everyone.
I had to run both of the following commands to resolve this issue.
Possibly the wording on the following error message could be updated to indicate that both of these commands may be required.
Change:
Please remove any global installs with one of the following commands:
To:
Please remove any global installs with one or both of the following commands:
Thanks 😊😊
On Thu, Nov 26, 2020, 12:02 Rishav Sinha notifications@github.com wrote: