【问题标题】: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您正在运行 `create-react-app` 4.0.3,它落后于最新版本 (5.0.0)。我们不再支持全局安装 Create React App
【发布时间】:2022-01-21 08:46:51
【问题描述】:
C:\Users\lg\Desktop> npm uninstall -g create-react-app

up to date, audited 1 package in 216ms

found 0 vulnerabilities
C:\Users\lg\Desktop>npx clear-npx-cache
Need to install the following packages:
  clear-npx-cache
Ok to proceed? (y) y
C:\Users\lg\Desktop>npx create-react-app@5.0.0 reduxapp
Need to install the following packages:
  create-react-app@5.0.0
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

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/

C:\Users\lg\Desktop>npm i tar

up to date, audited 153 packages in 1s

6 packages are looking for funding
  run `npm fund` for details

3 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
C:\Users\lg\Desktop>npx create-react-app@5.0.0 reduxapp

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/

我尝试通过谷歌搜索解决,但似乎出现错误,无法创建文件夹。

【问题讨论】:

  • 按照文档的建议,使用npx create-react-app my-app
  • 我试过了,“你正在运行create-react-app 4.0.3,它落后于最新版本(5.0.0)。我们不再支持全局安装 Create React App。”同样的警告。
  • 确保您使用的是npx 而不是npm
  • 哪一部分?我想我正在使用 npx。

标签: reactjs redux


【解决方案1】:

如果您最近在旧版本上运行过,请尝试清除 npx-cache。

npx clear-npx-cache
npx install -g create-react-app react-app

【讨论】:

    【解决方案2】:

    还可以做的是以管理员身份进入控制台,位于用户文件夹中,然后输入此命令(在我的情况下,我使用的是 NPM)

    npm 卸载 -g create-react-app

    我们卸载它,然后我重新安装它

    npm install -g create-react-app

    瞧,它对我有用

    【讨论】:

      【解决方案3】:

      我使用了 npx create-react-app@latest my-app 。这对我有用

      【讨论】:

        猜你喜欢
        • 2022-01-18
        • 2021-10-23
        • 2022-06-13
        • 1970-01-01
        • 2022-08-17
        • 2022-01-18
        • 2022-01-18
        • 1970-01-01
        • 2019-04-16
        相关资源
        最近更新 更多