赞
踩
在使用npx create-react-app 命令,得到命令行反馈
You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.2).
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
进行全局卸载后,再次执行安装依然报错,经过查询,发现需要清理一下npx的缓存,即执行全局卸载命令后,再运行一下命令
npx clear-npx-cache
这时如果命令行提示
Need to install the following packages:
clear-npx-cache
Ok to proceed? (y)
输入y
继续安装clear-npx-cache的package包即可
然后再执行react的安装命令npx create-react-app 你的项目名称
即可顺利安装
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。