【问题标题】:I am getting this error while installing create-react-app package even after updating the package即使在更新包后安装 create-react-app 包时我也收到此错误
【发布时间】:2022-01-23 20:04:11
【问题描述】:
npx create-react-app my-app
Need to install the following packages:
  create-react-app
Ok to proceed? (y)

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.

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/

【问题讨论】:

    标签: reactjs react-native


    【解决方案1】:

    正如post 中已经提到的,尝试删除 npx 缓存

    npx clear-npx-cache
    

    【讨论】:

      【解决方案2】:

      正如错误中所说,您需要删除 create-react-app 的全局安装,因此请根据您使用的是 npm 还是 yarn 运行这两个命令:

      - npm uninstall -g create-react-app
      - yarn global remove create-react-app
      

      完成后,再次在您的目录中打开终端并使用 npx 命令。它应该可以解决问题。

      npx create-react-app my-app
      

      【讨论】:

      • 删除 react 全局安装后出现同样的错误
      • 我已经重新安装了node JS,但是得到了同样的错误
      • 你不需要删除 react 或 node.只需删除 create-react-app。运行我提到的两个命令,然后打开另一个终端并再次运行 npx 命令。
      • 完成但错误相同
      • 请帮我解决这个错误,我无法完成我的项目
      猜你喜欢
      • 1970-01-01
      • 2021-09-07
      • 2020-03-02
      • 1970-01-01
      • 2013-10-24
      • 1970-01-01
      • 2020-04-18
      • 2021-06-10
      • 2020-11-13
      相关资源
      最近更新 更多