【发布时间】:2019-07-22 18:51:49
【问题描述】:
我不断得到:
C:\AppData>npm start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\AppData\Roaming\npm-cache\_logs\2019-02-28T18_08_25_285Z-
调试日志
我的包文件如下:
{
"name": "first",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.3",
"react-dom": "^16.8.3",
"react-scripts": "2.1.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
"cover 99.5%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
我是 npm 新手,当我第一次下载它时,我能够在本地服务器上启动它,没有问题。
我想打开我的浏览器,但在这样做的过程中,突然 npm start 出现了问题。
我知道还有其他类似的问题,但没有一个能缓解我的问题。
【问题讨论】:
-
npm run start?.. -
你需要在你的package.json中定义启动动作,查看下面的答案stackoverflow.com/a/31976870/2336650
标签: javascript reactjs npm