【问题标题】:You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.3)您正在运行 `create-react-app` 4.0.1,它落后于最新版本 (4.0.3)
【发布时间】:2021-10-23 06:10:27
【问题描述】:

运行后npm uninstall -g create-react-app

然后npm install -g create-react-app 我仍然收到相同的消息并且create-react-app 版本没有更新。我也试过npm install -g create-react-app@4.0.3,但没有得到我的解决方案。现在我无法创建任何反应 CLI 应用程序。我该如何解决?

【问题讨论】:

  • 它有助于实际阅读您向他人展示的文本。通知字面意思告诉您该怎么做:卸载全局 create-react-app,然后转到该 URL 阅读如何使用 create-react-app,因为不再支持全局安装。另外,记得关注posting guidelines。不要发布文字图片:将文字放在您的帖子中。
  • yarn global remove create-react-app 不删除create-react-app 包。
  • 这就是阅读文本仍然很重要的地方:它说使用“​​以下之一”,而不是同时运行。如果你是用npm安装的,那么你需要用npm卸载它,如果你用yarn安装它,你需要用yarn卸载它。

标签: reactjs npm create-react-app react-scripts


【解决方案1】:

这对我有用:

npx create-react-app@latest my-app

BenJenkinson 在此处回答:https://github.com/facebook/create-react-app/issues/10601

【讨论】:

    【解决方案2】:

    而不是全局安装创建反应应用程序使用npx create-react-app

    甚至 react 建议您不要在创建 react 应用程序的readme 中引用其全局安装它。

    如果您之前通过npm install -g create-react-app 全局安装了create-react-app,我们建议您使用npm uninstall -g create-react-appyarn global remove create-react-app 卸载该软件包,以确保npx 始终使用最新版本。

    【讨论】:

    • 是的:它在他们在帖子中显示的通知中建议他们。这不需要答案,这需要“请按照文字告诉您的去做”。
    猜你喜欢
    • 2022-01-18
    • 2022-06-13
    • 2022-01-21
    • 2022-08-17
    • 2022-01-18
    • 2022-01-18
    • 2021-12-29
    • 1970-01-01
    相关资源
    最近更新 更多