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
Misleading statement: "You almost never need to update create-react-app itself" #6140
A few weeks I started a new project with the new version of create-react-app --typescript. In the process I intended to update create-react-app. I searched about it and arrived at this page (Create-React-App documenation), where I read:
You almost never need to update create-react-app itself: it delegates all the setup to react-scripts.
When you run create-react-app, it always creates the project with the latest version of react-scripts so you’ll get all the new features and improvements in newly created apps automatically.
I figured out updating CRA is not necessary.
As a result the new project of create-react-app was not created properly (see here). Files were not created with .tsx extension, typescript and type libraries were not installed etc.
I also had another related bug - running npx create-react-app --info produced an error.
Yesterday I updated Create-React-App itself and that solved the bugs. I had a relatively updated version of create react app as I reinstalled everything on this computer 4 months ago.
Can you please remove the statements above, or update them?
In my case, I had create-react-app@1.5.2 globally installed on my local machine. Even when using the suggested typescript setup command for a new project in the docs (using npx) I still wasn’t getting a tsconfig/.tsx files etc.
I’ve since realised that npx was defaulting to my locally installed version of create-react-app, so deleting this was enough to get npx looking for the latest version.
Not sure if this is too opinionated to be in the scope of the docs, but perhaps suggesting that users don’t install a global version of CRA locally would be useful?
Yes this had come up a few times recently. I think adding something to the docs to call this out would be helpful for users that have previously installed it globally.
I just visitied https://facebook.github.io/create-react-app/docs/getting-started. Installtion instructions have changed; I think in the past users were recommended to run something like `npm i -g create-react-app". So I guess this is the source of the problem.
I've created #6157 to hopefully clear this up. It's come up a number of times recently after the addition of the --typescript option to the CLI. For users that have an older version installed globally, npx will use that cached version.
@ianschmitz, thanks! #6157 is great, but I think updating-to-new-releases.md is still misleading, and should be updated. Someone who installed the global version of CRA is likely to visit the "updating to new releases" page.
Activity
tomvalorsa commentedon Jan 7, 2019
Just experienced the same problem.
In my case, I had
create-react-app@1.5.2globally installed on my local machine. Even when using the suggested typescript setup command for a new project in the docs (usingnpx) I still wasn’t getting a tsconfig/.tsx files etc.I’ve since realised that
npxwas defaulting to my locally installed version ofcreate-react-app, so deleting this was enough to getnpxlooking for the latest version.Not sure if this is too opinionated to be in the scope of the docs, but perhaps suggesting that users don’t install a global version of CRA locally would be useful?
ianschmitz commentedon Jan 7, 2019
Yes this had come up a few times recently. I think adding something to the docs to call this out would be helpful for users that have previously installed it globally.
mrmckeb commentedon Jan 8, 2019
Perhaps we should even recommend users remove global installs, and avoid those wherever possible.
carpben commentedon Jan 8, 2019
I just visitied https://facebook.github.io/create-react-app/docs/getting-started. Installtion instructions have changed; I think in the past users were recommended to run something like `npm i -g create-react-app". So I guess this is the source of the problem.
Add note for global install of CLI
ianschmitz commentedon Jan 9, 2019
I've created #6157 to hopefully clear this up. It's come up a number of times recently after the addition of the
--typescriptoption to the CLI. For users that have an older version installed globally,npxwill use that cached version.Add note for global install of CLI (#6157)
Update updating-to-new-releases.md
carpben commentedon Jan 13, 2019
@ianschmitz, thanks!
#6157 is great, but I think updating-to-new-releases.md is still misleading, and should be updated. Someone who installed the global version of CRA is likely to visit the "updating to new releases" page.
carpben commentedon Jan 13, 2019
I submitted a PR #6190 to update
updating-to-new-releases.md.Add note for global install of CLI (react#6157)
Fork update (#6)
Wizard to 3.0.1 (#28)