-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"npx create-react-app my-app" stopped working in 4.0.3 #10601
Comments
Doesn't work for
|
Faced a similar problem. The package was not installed globally, but there is no way to deploy the project |
I just encountered this problem as well. As a possible workaround, this worked for me:
|
Many thanks. It helped. Launched |
So all we have to do is sit tight and wait for a new release? That seems reasonable. We can simply keep this issue open till 4.0.4 comes out and then we go back and check that you no longer need to add the |
I'm not sure it's related to
create-react-app/packages/create-react-app/createReactApp.js Lines 204 to 211 in 8bf050a
|
You're right! I didn't even notice the
So you're definitely thinking that this need to be installed and that it would use the latest and greatest. I guess the mystery is; where and why is |
This same kind of issue has been reported several times now:
These were all ultimately resolved with either:
Or, in one case (#10495 (comment)), the exact opposite of what the error message tells you to do:
I suspect this is because the warning against "global" installs is really just checking for "is the version being run the latest version" which would be OK immediately after installing it globally, but then wouldn't be OK two weeks & two new versions later. There are also a lot of solutions that suggest completely uninstalling and reinstalling node & |
Thanks! This worked for me. |
So a lot of people fall into this pitfall. Bummer. If we change the documentation to recommend using |
I think there are two scenarios that can happen, and I think the error message is shown for both but the contents of the error message only apply to one of the scenarios.
I also don't think it helps that the error message is so definitive about the global install being the only reason you're seeing the error (it's not checking for a global install after all, only checking if there's a newer version) |
Excellent! A solution could be to improve the error messaging to mention this thing about it being potentially cached. Because I don't have A middle-ground option might be to mention some of these things, as a loud warning/note, in the documentation. (Also, I hate that I now have 3 ways of running NPM packages: |
@BenJenkinson I can confirm that running out-of-date I think it's very unreasonable to require latest release. Many companies requires developers to use internal npm repo, which is often a few days or weeks behind. I don't see the point forcing everyone to use up-to-date version, unless there's a severe security issue. |
No one is saying that that is what you have to do. |
@Fnjn I don't think the purpose was to force you to use a latest version. As far as I understand, there are issues that can occur if you run But the check was written to check for when you're not running the latest version (which would occur in a "global" scenario); presumably on the assumptions that I think the CLI bug is that that assumption is wrong. As we've seen, So, where did the change come from?
|
I did some digging, and this may be an It looks like this is fixed in the latest releases of This was the trail I took: |
I'm sorry @mrmckeb, I assumed that So it looks like npm/cli#2597 has fixed " That would fit my own situation (because I was using |
Latest version of npm fixed it for me.
then: Running from terminal in VS code did not ask this, and seems to worked as usual. |
It's very much OK @BenJenkinson, that info wasn't easy to find - I'd obviously done that digging before which is why I was also confused. Thanks for the update @PaulB-H. I'd recommend instead that you remove the global install for future, as you won't need it with npx :) @peterbe is it OK if we close off this issue now? After you confirm that it now works of course :) |
Yeah. Sure. Part of me wishes the documentation or the error message could have done the kind of handholding I needed @BenJenkinson 's comment about using And to be honest, I still don't know why my system thinks there's a
But I still get the error every time:
So the message "You are running Actually, I still have no idea where this
But perhaps my system is just too screwed up to hold back the great work of |
This works for me! |
Hi, I have tried all of the solutions but this worked for me - leaving the Hope this would be helpful! |
Perfect, this works. Thank you! |
Thank you evank21 I also had the above issue and what you said worked for me |
just update npx to latest version => |
This helps me to restart my react app. A reasonable workaround while I'm still learning React.I have tried uninstalling the create-react-app from the global scope, even re-install the nodejs & npm completely. I'm learning React in Centos Stream 8. Then use It seems I have to manually change the version of react-scripts from 4.0.3 to 4.0.1 inside the "package.json" file of the react-app directory.
Then run the command: Hope that works for you all until the issue is fixed! |
This still buggy at create-react-app@4.0.3 by npx@7.18.1 which seems to come with node@16.4.1 Get around is to install create-react-app in separate project that can later be deleted. In you parent directory:
|
Thanks! It worked. |
Thank you Sir! It helped |
Hi, npm uninstall -g create-react-app It works for me. |
Also what one can do is enter the console as administrator, located in the user's folder, and put this command (in my case I used the NPM one) npm uninstall -g create-react-app we uninstall it and then I reinstall it npm install -g create-react-app and voila, it worked for me |
It is not working for me... |
this is work and can somebody say why? |
So for anyone on windows - I actually had to go to Add/Remove Programs and remove NVM from there Doing that and the commands above after a fresh npm install everything worked. |
@drustin2 give more details? |
npx clear-npx-cache fixed the issue for me: I no longer have to specify |
Actual workaround to use non-latest version: #12022 (comment) |
Thank you, this works. I think everyone will experience this each time a new version of React is released. |
I Have been experiencing this issues and i need help on how to install react on my vs code
Need to install the following packages: npm ERR! A complete log of this run can be found in: THIS IS THE ERROR MESSAGE I HAVE BEEN GETTING!!!😢😢😢 |
@CallmeKelly can you confirm when you see the line |
Describe the bug
If
create-react-app
is not meant to work withnpx
, then https://create-react-app.dev/docs/getting-started/ is wrong.Did you try recovering your dependencies?
not applicable
Which terms did you search for in User Guide?
npx
Environment
OSX Big Sur
npm 7.5.6
node v15.2.1
Steps to reproduce
Expected behavior
That it should create a directory called
my-app
.Actual behavior
See error above.
Reproducible demo
Not applicable.
The text was updated successfully, but these errors were encountered: