问题
由于之前全局安装过 create-react-app ,今天在创建新的项目时,想使用 npx create-react-app my-app --template typescript
命令来创建,报了以下错误
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
We no longer support global installation of Create React App
于是我使用 npm uninstall -g create-react-app
命令全局卸载了无效。
使用 npm cache clean --force
还是无效,重启电脑也无效,简直要发疯。
解决
最终找到了以下命令,执行后,就可以使用 npx create-react-app my-app --template typescript
命令来创建新的项目了。
npx clear-npx-cache