今天创建react项目的时候出现提示:
You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
解决方式:
1. 卸载全局安装的create-react-app
yarn global remove create-react-app
2. 直接执行创建项目命令
npx create-react-app 项目名称
或者采用下面这种方式解决:
npm uninstall -g create-react-app
npx clear-npx-cache
npm i create-react-app
npx create-react-app@latest my-app