当我尝试运行我的React应用时,出现此错误。我试图从PC上杀死本地主机,但出现了相同的错误:
Windows操作系统 “ axios”:“ 0.19.0”, “ classnames”:“ 2.2.6”, “ is-empty”:“ 1.2.0”, “ jwt-decode”:“ 2.2.0”, “ react”:“ 16.8.6”, “ react-dom”:“ 16.8.6”, “ react-redux”:“ 7.0.3”, “ react-router-dom”:“ 5.0.0”, “ react-scripts”:“ 2.1.8”, “ redux”:“ 4.0.1”, “ redux-thunk”:“ 2.3.0”
> new@1.0.0 start C:\Users\leult\documents\meda\files\BACKEND\PasswordAuthentication\mern-auth\my-app
> react-scripts start
Starting the development server...
events.js:177
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:84:9)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:84:9) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! new@1.0.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the new@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\leult\AppData\Roaming\npm-cache\_logs\2019-06-02T11_01_00_923Z-debug.log
I tried to kill all running localhost but the same
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\leult\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm@6.9.0
3 info using node@v12.3.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle new@1.0.0~prestart: new@1.0.0
6 info lifecycle new@1.0.0~start: new@1.0.0
7 verbose lifecycle new@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle new@1.0.0~start: PATH: C:\Users\leult\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\leult\documents\meda\files\BACKEND\PasswordAuthentication\mern-auth\my-app\node_modules\.bin;C:\Users\leult\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\leult\bin;C:\Python27;C:\Python27\Scripts;C:\Program Files\Microsoft MPI\Bin;C:\Program Files\Java\jdk1.8.0_191\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\Tools\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn;C:\Users\leult\AppData\Local\Programs\Python\Python37-32;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\leult\AppData\Local\Microsoft\WindowsApps;C:\ProgramData\leult\atom\bin;C:\Users\leult\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\leult\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Users\leult\Anaconda3\Scripts;C:\Users\leult\AppData\Local\GitHubDesktop\bin;C:\Users\leult\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;C;WindowsSystem32
9 verbose lifecycle new@1.0.0~start: CWD: C:\Users\leult\documents\meda\files\BACKEND\PasswordAuthentication\mern-auth\my-app
10 silly lifecycle new@1.0.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle new@1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle new@1.0.0~start: Failed to exec start script
13 verbose stack Error: new@1.0.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\leult\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:200:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\leult\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:200:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid new@1.0.0
15 verbose cwd C:\Users\leult\documents\meda\files\BACKEND\PasswordAuthentication\mern-auth\my-app
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\leult\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.3.1
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error new@1.0.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the new@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]