为了账号安全,请及时绑定邮箱和手机立即绑定

REACT npm 启动命令

REACT npm 启动命令

狐的传说 2023-07-20 17:05:33
我刚刚使用 create-react-app 命令创建了一个 React 应用程序,并将该应用程序命名为react-app。我按照以下步骤操作cd使用进入该目录cd react-app/运行npm start命令我遇到了一个错误:npm ERR! Missing scripts: startnpm 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 中是有效的,但引发了另一个问题。这是片段。
查看完整描述

1 回答

?
红颜莎娜

TA贡献1842条经验 获得超12个赞

您必须在 package.json 中包含这些脚本。


我的package.json


"scripts": {

    "start": "react-scripts start",

    "build": "react-scripts build",

    "test": "react-scripts test",

    "eject": "react-scripts eject"

  }


查看完整回答
反对 回复 2023-07-20
  • 1 回答
  • 0 关注
  • 122 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信