【问题标题】:react error-error: This is probably not a problem with npm. There is likely additional logging output abovereact error-error:这可能不是 npm 的问题。上面可能有额外的日志输出
【发布时间】:2020-11-16 12:14:46
【问题描述】:

在我的项目中,我使用的是 react。现在我要做的是将远程服务器中的项目部署到实际服务器中。我正在使用 npm 创建和启动一个项目。但是我无法构建我的项目,因为一次又一次出现以下错误,

C:\Users\User\react-tutorial>npm start

> react-tutorial@0.1.0 start C:\Users\User\react-tutorial
> react-scripts start

i 「wds」: Project is running at http://192.168.225.236/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\User\react-tutorial\public
i 「wds」: 404s will fallback to /
Starting the development server...

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-tutorial@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-tutorial@0.1.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\User\AppData\Roaming\npm-cache\_logs\2020-07-27T07_26_30_467Z-debug.log

我该如何解决这个问题?

编辑:它成功了,我得到了答案

【问题讨论】:

标签: javascript html css reactjs react-native


【解决方案1】:

已经问过here

尝试将 C:\Windows\System32 添加到全局 PATH 环境变量或使用清除 npm 缓存

npm cache clear --force

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-27
    • 1970-01-01
    • 2021-02-13
    • 2019-08-30
    • 2020-09-11
    • 2020-05-10
    • 2020-10-13
    • 1970-01-01
    相关资源
    最近更新 更多