繁体   English   中英

纱线开始 - 找不到命令“开始”

[英]yarn start - command “start” not found

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

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

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

cmd 错误:命令提示符

package.json:

  "name": "confusion",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM