Skip to content

Commit 2da5517

Browse files
authored
Explain how to uninstall create-react-app globally (#9244)
* Explain how to uninstall create-react-app globally * Add uninstallation intructions for yarn
1 parent abe2369 commit 2da5517

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cd my-app
1717
npm start
1818
```
1919

20-
If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that npx always uses the latest version.
20+
If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that npx always uses the latest version.
2121

2222
_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_
2323

docusaurus/docs/adding-typescript.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npx create-react-app my-app --template typescript
1919
yarn create react-app my-app --template typescript
2020
```
2121

22-
> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that `npx` always uses the latest version.
22+
> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that `npx` always uses the latest version.
2323
>
2424
> Global installs of `create-react-app` are no longer supported.
2525
@@ -47,7 +47,7 @@ You are not required to make a [`tsconfig.json` file](https://www.typescriptlang
4747

4848
## Troubleshooting
4949

50-
If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`. Remove previously installed versions with `npm uninstall -g create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).
50+
If your project is not created with TypeScript enabled, npx may be using a cached version of `create-react-app`. Remove previously installed versions with `npm uninstall -g create-react-app` or `yarn global remove create-react-app` (see [#6119](https://github.com/facebook/create-react-app/issues/6119#issuecomment-451614035)).
5151

5252
If you are currently using [create-react-app-typescript](https://github.com/wmonk/create-react-app-typescript/), see [this blog post](https://vincenttunru.com/migrate-create-react-app-typescript-to-create-react-app/) for instructions on how to migrate to Create React App.
5353

docusaurus/docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cd my-app
1414
npm start
1515
```
1616

17-
> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` to ensure that `npx` always uses the latest version.
17+
> If you've previously installed `create-react-app` globally via `npm install -g create-react-app`, we recommend you uninstall the package using `npm uninstall -g create-react-app` or `yarn global remove create-react-app` to ensure that `npx` always uses the latest version.
1818
1919
_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/gaearon/4064d3c23a77c74a3614c498a8bb1c5f))_
2020

packages/react-scripts/scripts/init.js

+7
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ module.exports = function (
103103
'create-react-app'
104104
)} are no longer supported.`
105105
);
106+
console.error(
107+
`You can fix this by running ${chalk.cyan(
108+
'npm uninstall -g create-react-app'
109+
)} or ${chalk.cyan(
110+
'yarn global remove create-react-app'
111+
)} before using ${chalk.cyan('create-react-app')} again.`
112+
);
106113
return;
107114
}
108115

0 commit comments

Comments
 (0)