-
-
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
We no longer support global installation of Create React App #12022
Comments
It's not an error it's just a warning. Facebook suggests to use latest version of CRA for creating apps. Use this instead
For more info refer to this stack overflow question |
You mean this one
I had a same problem and this has solved the problem. but should be working without designating version or latest in the future I hope. |
Is there a way to skip this error and force running a certain version of CRA instead of installing the latest one? |
Then try this Then in your folder where you want to create the application
This should work |
I got the same error even when doing simply:
Then I tried:
Same error again. The only way I was able to get cra working at all was via the following command: npx create-react-app@latest my-new-app # only command that works now!
False. It fails to "create a react app". Therefore, it is an error. |
Ok. I can’t verify myself coz I am running into other errors which are not very known to me. You have to wait for a developer of this package who might help you out. |
It won't work even if you install create-react-app as an npm package in a separate project and try to run it from there. However there can be cases that require Please don't burn the bridges for those who can't jump to the latest 5.x cra :) |
Haha agreed! |
try it? https://zhuanlan.zhihu.com/p/296542499 Steps: # WINDOWS 10
# clone cra and checkout to old version
git clone https://github.com/facebook/create-react-app.git
cd ./create-react-app
git checkout -b v4.0.3 v4.0.3
# install lerna that cra needed, and run bootstrap
npm i -g lerna
lerna bootstrap
# npx create-react-app using old files
cd ../
npx create-react-app cra-project-old --scripts-version file:.\create-react-app\packages\react-scripts --template file:.\create-react-app\packages\cra-template-typescript
# edit dependencies and re-install
cd ./cra-project-old
# replace following:
# "react": "^17.0.2",
# "react-dom": "^17.0.2",
# "react-scripts": "file:../create-react-app/packages/react-scripts",
# to it:
# "react": "^16.12.0",
# "react-dom": "^16.12.0",
# "react-scripts": "^4.0.3",
rimraf node_modules
rimraf package-lock.json
npm i
# it's all right! |
It looks from the source code that trying to use any version but the latest version errors out. Maintainers: could we at least get an appropriate error message if the problem is trying to use an unsupported version? Or possibly allow installing with an older version of CRA, with a warning? |
I'll definitely be typing npx create-react-app@latest my-app until they figure this out lol. |
Seeing this as well. The instructions provided lead to an infinite loop. |
Possibly related to: #10601 and npm/cli#2329 Also helpful: (Though, I guess this does not fix the original issue the OP was interested in, which was CRA not allowing a version prior to |
If nothing else works for you:
|
My workaround is to install globally and use global version. This will use version v4 of |
I solved this problem with this command:
|
The readme really should be updated. Right now the website displays instructions that just don't work, or at least not for everybody. |
That worked for me. The documentation should suggest that you might need to clear the npx cache. |
This Works for me, thanks |
Thanks man, this works. However, it's crazy that we need to do this to use an older version |
You should maybe try to do : It worked for me ! |
Here is what works for me: mkdir my-app You could probably use @latest instead of @5.0.1. |
I think, that problem is deeper. There is no stable version in cra. We have only latest, but it's not stable. Also I have my own template, that use my company. I'm very frustrating, when I cannot create new app. lastest cra break compatibility with common tools and have no possibility to install previous more stable version. I suggest to support two versions - stable and latest. In that case maintainers don't have to support all possible versions of cra, but only two. If users of cra are getting errors with latest, they have stable version, that ok. Stable version should support all common used tools like storybook by scratch. |
npx clear-npx-cache |
|
This is the only way it worked. I tried to clear cache, install the latest create-react-app. As many commented before, the outcome is not just a warning. It does not create an app. Hence, this is a serious bug. Create-react-app should consider a quick response. |
I tried every command and every suggestion here. nothing worked. It didn't provide any kind of template, not even with the template flag. There is one thing that is working to get the template: I hope they will fix this soon. |
I got this issue too. I did what @adimshev said with clear cache and it worked. I was promted to install create-react-app@5.0.1 after clearing cache and running npx cra again. Now all subsequence npx create-react-apps also work fine!
|
I am really getting tired of all the problems of CRA, and still it keeps surprising me. The latest version creates apps with react 18, which might be an issue for many reasons. And now they don't even allow using older versions? Or options to select the react version to use? This is simply absurd. I work in programming education and I am really going to consider switching to another approach, no more recommending students to use this. |
npx create-react-app@latest ui --template typescript --use-npm Because: ``` npx create-react-app ui --template typescript --use-npm You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.1). We no longer support global installation of Create React App. ``` Even though: ``` % which create-react-app create-react-app not found ``` ``` % npm uninstall -g create-react-app up to date, audited 1 package in 121ms found 0 vulnerabilities ``` ``` % yarn global remove create-react-app yarn global v1.22.17 [1/2] 🗑 Removing module create-react-app... error This module isn't specified in a package.json file. info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command. ``` See facebook/create-react-app#12022.
I'll add to the chorus that this is completely uncool. I received the same wrong error message following the wrong instructions that CRA publishes for "getting started". In this case I am putting together a toy application to debug a problem (not really React-related) with a large React application and CRA is potentially a big help if it can save time setting up. I guess for work I'd have to set the whole thing up manually with CRA and I probably would have, but if it was a side project I'd seriously think about ditching React for Svelte or somebody else who attends to having correct instructions for the most critical operation (getting started). |
Having the same issue i came there but i found a way to pass through this error: Wanting to create a react app with "npx create-react-app ." ? use instead cd ../ Hope it can helps & Also Enjoy Coding |
Just like any other library upgrade, I upgraded "create-react-app" and it worked in 2 simple steps :-
Now, create react app with |
I use React here and there, everything I come back is buggy |
Describe the bug
I'm not comfortable with all of the critical bugs in the recently released CRA 5.0.0, so want to use the most recent reliable v4 instead, 4.0.3.
Can't use
npx create-react-app
any more due to following error.npm version: 8.1.0
Steps to reproduce
Try creating a new react app using CRA.
npx create-react-app@4.0.3 your-new-app
npm uninstall -g create-react-app
Expected behavior
Should create a new CRA app.
Should not care about latest release.
Actual behavior
Error.
The text was updated successfully, but these errors were encountered: