【发布时间】: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
【问题讨论】:
-
npm i react-scripts
-
也许这个链接会帮助你stackoverflow.com/questions/31976722/…。
-
感谢@Ntshembo Hlongwane。该链接非常有帮助。我很感激
标签: javascript reactjs npm