-
-
Notifications
You must be signed in to change notification settings - Fork 27k
You are running create-react-app
4.0.3, which is behind the latest release (5.0.0). We no longer support global installation of Create React Ap
#11816
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
Comments
I encountered the same issue. I have tried almost everything. uninstall, clear cache, and use npx create-react-app@5.0.0 but still not working. but the yarn does work. Can anyone help? |
Hello, I just came across this problem, and I found that with this I could solve it npx create-react-app@latest {project name} |
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 and voila, it worked for me |
Thank you. I just fixed it by running |
I would advice against installing npm packages globally. Thus I would recommended that you instead do:
This is the preferred installation method according to the react docs. npx is included in newer versions of npm and you shouldn't need to install it. Edit: Thanks to @strongmove for suggesting to add |
@MrEmanuel, the problem is that
does not solve the |
So this is what happens when running
The solution as mentioned above is to just use |
I have encountered this issue last week and my take is |
npx clear-npx-cache worked for me. |
I updated my answer to include the command do clear the cache as per the comment from @strongmove |
@chuchude Thank you Her is the solution => Thank you. I just fixed it by running npm install -g create-react-app@5.0.0 |
Thank you ..! Cant you please let me know that how to ren the project ? --> I tried " react-scripts start " this but cant run the program. :( |
it works thanks 👍 ❤ |
Thank you so much |
just run Uninstall create-react-app by running this code in your terminal
After uninstall done, install it again to test |
Please avoid doing this. As mentioned in the docs (https://github.com/facebook/create-react-app#quick-overview), it is preferred to always run This answer here is better in general #11816 (comment) |
@marko-hologram the whole point of this issue report is that uninstalling the old CRA globally does not work for some people and the error message is seen even after uninstalling |
Yes I understand that. There are potentially cases where people somehow have CRA installed globally in multiple places and they should uninstall it in multiple places potentially. I wanted to point out that installing the package globally doesn't really fix the issue and isn't the ideal solution going forward 😄 If people would follow the docs initially they wouldn't even have CRA installed globally (since docs suggest you shouldn't have global installs) and would avoid all of these issues altogether. |
Yes, but those people are not reading this bug report because CRA works for them. The people for whom this bug report is useful are people who had installed CRA globally and now find that uninstalling it globally, as advised by the CLI, doesn't work. You're telling them that they should try to uninstall it (they already tried) and that they shouldn't have installed it globally in the first place (they can't change the past). How does it help? |
I'm trying to suggest to them to actually take time and try to fix the underlying issue completely. Most of these GitHub issues I've seen here where people have trouble bootstrapping a CRA project are caused by a global install of CRA. So by taking a bit of time and fixing the issue they will make it easier for maintainers and for themselves in the long run. Re-installing it as global dependency is a temporary fix that will bite them in the ass later again and they will come here again and open another issue unnecessarily. |
Yet you don't mention how: you merely point them to a comment that tells them to uninstall the global CRA and clear the npx cache, which is what this user tried in the second post, without success. Again, how does this help? |
Because I cannot pinpoint which of the possible fixes might apply to them. I'm at least trying to steer them in the right direction in order to find the solution instead of applying a temporary fix.
That person didn't specifically mention that they cleared |
I fixed this issue without running any scripts.
I ended up doing this to clear cache under Ubuntu:
The result was:
TLDR: Clear both root and user npm cache
|
Clearing
For more details, {
"dependencies": {
"create-react-app": "^4.0.3"
}
} EDIT: Adam's answer is definitely the B plan if npx script doesn't work : manually nuke npx cache folder 🚀 |
I fixed this issue by changing the version of the
|
I'm guessing this works because different node versions that are managed by NVM have their own separate caches and install locations? If you go back to your v16.11.1 it potentially won't work again and one of the solutions in these comments could work for you. Just so that you aren't always stuck on Node v14. |
None of the above listed solutions work for me, when trying to install v4.0.3 of I don't have CRA globally installed in neither npm nor yarn. Nuking npm cache folder did not help.
|
Clearing the cache via npx clear-npx-cache worked for me as well |
the new version is working terrible with web3, why prevent the use of previous version? |
I did this instead:
|
this work for me. |
This worked for me. |
Since they no longer support the global installation of Create React App.
Then install locally (root of your project):
Then just create new app using the create-react-app |
This worked when I removed the { } |
|
For me, 'npm uninstall -g create-react-app' did the job. Then -> npx create-react-app project-name . Hope this works. |
Worked for me as well! |
It worked!!!! Awesome advice |
This super works for me as I don't want to use latest version (5.x.x). Thanks! |
this fix the issue for me:
hope this will help |
Just a quick suggestion which able to fix this issue.
that's it |
My solution was just installing latest and downgrading react version in the app. 1 - and then in the import ReactDOM from 'react-dom/client';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
); to import ReactDOM from 'react-dom';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
); |
this woring from my problem, thanks bro 🔥🔥🔥 |
This answer was awesome! And just for the sake of making it super easy (and if you want typescript in your project):
|
I tried everything then use these commands |
This fixed it for me! |
This worked perfectly for me! |
Even
I currently don't have a way to run CRA version 4 with node 12 |
I am running Node 16.15.0 and still no joy. So upgrading wouldn't help. |
just encountered this issue
|
If |
edit createReactApp.js around checkForLatestVersion()(line:204) and run
|
It worked for me too. Thanks a lot. |
took me a while to understand:
and run following:
|
just use |
Good job bro! Thats worked for me! |
No description provided.
The text was updated successfully, but these errors were encountered: