繁体   English   中英

错误:您正在运行 `create-react-app` 5.0.0,它落后于最新版本 (5.0.1)

[英]Error: You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1)

正如标题所说,我无法运行 create-react-app。

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

这样做不会改变错误。 npm uninstall -g create-react-app

我输入此命令进行试用,并收到一条消息,指出 tar 已过期。 npm install -g create-react-app

npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code EEXIST
npm ERR! path /opt/homebrew/bin/create-react-app
npm ERR! EEXIST: file already exists
npm ERR! File exists: /opt/homebrew/bin/create-react-app
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:

https://www.npmjs.com/package/tar

我用这个参考运行了命令。

但是,tar 没有更新。 我已经尝试了所有已发布的解决方案,但它们不起作用。 有人可以帮帮我吗? 请。

我尝试清除缓存但无法解决问题。 npx clear-npx-cache

Need to install the following packages:
  clear-npx-cache
Ok to proceed? (y) y

每次指定版本都能成功运行下面的命令,但是比较麻烦,希望能正常运行。 npx create-react-app@latest my-app

我目前使用的“鱼”shell 是节点 v18.0.0,所以我降级到 v16.15.0,它工作正常。

fisher install jorgebucaran/nvm.fish

nvm install v16

我忘记降低 fish 中的节点版本,因为它在 zsh 上运行良好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM