【问题标题】:In Vscode I am facing a problem while creating a react app在 Vscode 中,我在创建反应应用程序时遇到了问题
【发布时间】:2022-01-07 00:41:28
【问题描述】:

我已经使用了命令

> npx create-react-app my-app

Need to install the following packages:
  create-react-app
Ok to proceed? (y)
 // I apply the command but the result is
Ok to proceed? (y) 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 visual-studio-code installation


    【解决方案1】:

    尝试运行npx clear-npx-cache清除缓存,然后运行npx create-react-app@latest my-app --use-npm安装最新版本

    【讨论】:

      【解决方案2】:

      首先,用命令npm --version检查你的npm版本,看看是不是因为你的npm版本太旧(我的是6.14.14)。重新安装npm看看是否解决了问题。

      如果没有,请尝试按照文档的建议卸载create-react-app,使用npm uninstall -g create-react-app,并且您不需要安装它npm 会为你解决这个问题。

      这是我目前能想到的两个建议。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-14
        • 1970-01-01
        • 2020-04-21
        • 1970-01-01
        • 2021-02-08
        • 1970-01-01
        相关资源
        最近更新 更多