【问题标题】:Failed to start a project with react使用 react 启动项目失败
【发布时间】:2020-08-27 21:11:50
【问题描述】:

用 react.js 开始一个项目,我创建了一个项目来编写 npm 启动一个项目我得到了错误,去那里说的地址,但我不知道如何解决它,因为我问的可以帮助你错误是这样的:npm Err!缺少脚本:开始。 Npm 错误!可以在 npm Err 中找到此运行的完整日志! C:-Users-Sanvicente-Appdata-Roaming-npm-cache-_logs-2020-08-27t20_09_40_583z-debug.log。 (我从 react 开始)enter image description here

【问题讨论】:

  • 你能分享你的源代码吗?此错误表明您的 package.json 中没有 npm "start" 脚本

标签: reactjs


【解决方案1】:

如果您使用 npx create-react-app <app_name> 命令创建了 React 应用程序,那么您应该在 <app_name> 文件夹中找到一个 package.json 文件。确保该文件具有以下内容:

"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }

【讨论】:

    猜你喜欢
    • 2017-05-28
    • 2019-04-21
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多