无法使用npx create-react-app“不再支持Create React App的全局安装”

bor*_*mez 15 npm reactjs create-react-app

我无法使用 create-react-app 创建新应用程序。我正在使用的命令是npx create-react-app appname --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
Run Code Online (Sandbox Code Playgroud)

我用 删除了全局包npm uninstall -g create-react-app。然后我检查了打包的文件是否未全局安装

  1. 跑步npm list -g
  2. 检查文件夹 C:\Users\my-user\AppData\roaming\npm

但 create-react-app 一直说我已经全局安装了“create-react-app 4.0.3”。

毕竟我清理了缓存并npm cache clean --force重新启动计算机,但结果相同。

我在 Windows 10、npm 7.18.1 和 Node 16.4.0 上运行

我缺少什么?

提前致谢

Jam*_*s L 47

这也抓住了我。你需要跑

npx clear-npx-cache
Run Code Online (Sandbox Code Playgroud)