1

yarn start导致错误提示找不到命令“start”。在我的 package.json 文件中没有脚本的标签,这可能是问题所在。请提出修复建议。

我正在尝试安装反应,命令是:

npm install -g create-react-app@1.5.2
create-react-app confusion
yarn start

cmd错误: 命令提示符

包.json:

  “名称”:“混乱”,
  “版本”:“0.1.0”,
  “私人”:真的,
  “依赖”:{
    “反应”:“^16.13.1”,
    “反应域”:“^16.13.1”,
    “反应脚本”:“3.4.1”
  }
}
4

1 回答 1

1
  1. npm uninstall -g create-react-app// 卸载旧的 create-react-app 版本(在您的情况下为 v1.5.2),以确保 npx 在步骤 2 中使用最新版本
  2. npx create-react-app my-react-app-name// npx 无需全局安装即可安装最新版本的 create-react-app。它包含在 npm 中,因此无需安装。如果您愿意,请将my-react-app-name替换为您希望调用项目的任何名称
  3. cd my-react-app-name
  4. yarn start
于 2020-07-22T12:36:29.253 回答