简体   繁体   English

为什么npm无法开始执行?

[英]Why won't npm start execute?

I keep getting: 我不断得到:

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 调试日志

My package file is as follows: 我的软件包文件如下:

{
"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"
   ]
 }

I'm new to npm, and when I first downloaded it, I was able to start it up on my local server no problem. 我是npm的新手,当我第一次下载它时,我可以在本地服务器上启动它,没问题。

I wanted to switch my browser up, and in doing so, suddenly npm start is having an issue. 我想打开我的浏览器,这样做突然使npm start出现了问题。

I know there are other questions similar, but none of them alleviate my issue. 我知道还有其他类似的问题,但是没有一个可以缓解我的问题。

正如@Arfeo所说,只需调用npm run start

Where is your package.json located? 您的package.json在哪里?

If your answer is, for example, c:\\AppData\\Eugene\\react-app you need to change directory (only once), 例如,如果您的答案是c:\\AppData\\Eugene\\react-app ,则只需更改目录(仅一次),

cd c:\AppData\Eugene\react-app

then run your npm commands 然后运行您的npm命令

npm start
npm run build

, etc.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM