为什么npm不会开始执行?

问题描述 投票:0回答:2

我一直在:

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- 

的debug.log

我的包文件如下:

{
"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出现了问题。

我知道还有其他类似问题,但没有一个能缓解我的问题。

javascript reactjs npm
2个回答
1
投票

正如@Arfeo所说,只需致电npm run start


1
投票

你的package.json在哪里?

如果您的答案是,例如,c:\AppData\Eugene\react-app您需要更改目录(仅一次),

cd c:\AppData\Eugene\react-app

然后运行你的npm命令

npm start
npm run build

© www.soinside.com 2019 - 2024. All rights reserved.