【问题标题】:Problems using react npx使用反应 npx 的问题
【发布时间】:2021-12-24 13:08:44
【问题描述】:

所以当我尝试在控制台上运行 npx create-react-app app-name 命令时出现错误,无论是在 vscode 还是在终端中。 控制台总是返回:

您正在运行节点 12.22.8。 Create React App 需要 Node 14 或更高版本。 请更新您的 Node 版本。

我尝试安装更新版本的节点,但这是不可能的,因为我使用的是 Windows 7,并且从版本 14 开始,它只支持 Windows 8。我尝试重新安装,但我也没有成功。有谁知道如何解决这个问题??

【问题讨论】:

标签: reactjs npx


【解决方案1】:

npx create-react-app app-name 与节点版本 14 或更高版本一起使用。对于较少的版本,首先您必须使用以下命令安装 create-react-app

npm uninstall -g create-react-app
npm install -g create-react-app@3.4.1
create-react-app my-app --scripts-version 3.1.1

最好先升级window再升级node版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-13
    • 2022-07-11
    • 2020-07-14
    • 2021-10-23
    • 2020-04-06
    • 2019-05-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多