当前位置:   article > 正文

vue-element-admin项目模板启动报错_at process.childprocess._handle.onexit (node:inter

at process.childprocess._handle.onexit (node:internal/child_process:283:19)

报错内容:

  1. > vue-admin-template@4.4.0 dev
  2. > vue-cli-service serve
  3. INFO Starting development server...
  4. 98% after emitting CopyPlugin
  5. DONE Compiled successfully in 6995ms 15:25:13
  6. App running at:
  7. - Local: http://localhost:9528/
  8. - Network: unavailable
  9. Note that the development build is not optimized.
  10. To create a production build, run npm run build.
  11. node:events:504
  12. throw er; // Unhandled 'error' event
  13. ^
  14. Error: spawn cmd ENOENT
  15. at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
  16. at onErrorNT (node:internal/child_process:478:16)
  17. at processTicksAndRejections (node:internal/process/task_queues:8Emitted 'error' event on ChildProcess instance at:
  18. at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
  19. at onErrorNT (node:internal/child_process:478:16)
  20. at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  21. errno: -4058,
  22. code: 'ENOENT',
  23. syscall: 'spawn cmd',
  24. path: 'cmd',
  25. spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:9528/' ]
  26. }

显示下列报错

  1. node:events:504
  2. throw er; // Unhandled 'error' event
  3. ^

可以将vue.config.js文件中,

  1. devServer: {
  2. port: port,
  3. open: open,
  4. overlay: {
  5. warnings: false,
  6. errors: true
  7. },
  8. before: require('./mock/mock-server.js')
  9. },

将其中的:    open:open,

改成:           open:false,

该语句作用是告诉dev-server在服务器启动后打开浏览器,

改完以后就可以通过打开本地端口进行访问了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/491970
推荐阅读
相关标签
  

闽ICP备14008679号