【发布时间】:2021-09-22 14:13:17
【问题描述】:
我已经安装了 nodejs 并检查了 nodejs、npm 和 npx 版本。一切似乎都很好并且执行了npm install -g create-react-app,并且它也得到了正确执行。但是在写create-react-app myapp 之后,它在命令提示符上显示了这个错误。
Creating a new React app in `C:\Users\Dell\Documents\Javascript Tutorial && Summer training\reactjs course\todolist`
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
events.js:352
throw er; // Unhandled 'error' event
^
Error: spawn C:\Windows\system32\cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Users\Dell\AppData\Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn C:\\Windows\\system32\\cmd.exe',
path: 'C:\\Windows\\system32\\cmd.exe',
spawnargs: [
'/d',
'/s',
'/c',
'"npm ^"install^" ^"--save^" ^"--save-exact^" ^"--loglevel^" ^"error^" ^"react^" ^"react-dom^" ^"react-scripts@0.9.x^""'
]
}
【问题讨论】:
标签: javascript node.js reactjs npm npx