【问题标题】:REACT npm start command反应 npm 启动命令
【发布时间】:2021-02-21 02:41:06
【问题描述】:

我刚刚使用 create-react-app 命令创建了一个 React 应用程序,并将该应用程序命名为 react-app。我遵循了这些步骤

  • cd 使用 cd react-app/ 进入该目录
  • 运行npm start 命令

我遇到了一个错误,上面写着:

npm ERR! Missing scripts: start
npm ERR! A complete log of this run can be found in:
C:\Users\user\Appdata\Roaming\npm-cache\_logs\2020-11-09T07_00_18_996z-debug.log

编辑:这是我的package.json的内容:

{
  "name": "react-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^17.0.1",
    "react-dom": "^17.0.1",
    "react-scripts": "4.0.0"
  }
}

将这些脚本添加到我的 package.js 有效,但引发了另一个问题。这是sn-p。谢谢大家enter image description here

【问题讨论】:

标签: javascript reactjs npm


【解决方案1】:

您的 package.json 中必须有这些脚本。

我的 package.json

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-31
    • 2022-01-11
    • 2018-01-11
    • 2019-11-29
    • 2019-09-29
    • 1970-01-01
    • 1970-01-01
    • 2018-02-05
    相关资源
    最近更新 更多