create-react-app卸载与升级

2023-03-07,,

用create-react-app 创建项目发现报错

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.

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:
https://create-react-app.dev/docs/getting-started/

按照

npm uninstall -g create-react-app

提示卸载旧版本 ,查看版本号发现 并没有卸载成功

此时 只能通过暴力删除法卸载了

➜  react-demos git:(master) ✗ which create-react-app
/usr/local/bin/create-react-app
➜ react-demos git:(master) ✗ rm -rf /usr/local/bin/create-react-app

  删除之后 通过查看版本号的方式 是否成功删除

➜  demo14_context git:(master) ✗ create-react-app -V
zsh: command not found: create-react-app

在安装最新版本create-react-app即可

npm install -g create-react-app

create-react-app卸载与升级的相关教程结束。

《create-react-app卸载与升级.doc》

下载本文的Word格式文档,以方便收藏与打印。