赞
踩
报错内容:
- > vue-admin-template@4.4.0 dev
- > vue-cli-service serve
-
- INFO Starting development server...
- 98% after emitting CopyPlugin
-
- DONE Compiled successfully in 6995ms 15:25:13
-
-
- App running at:
- - Local: http://localhost:9528/
- - Network: unavailable
-
- Note that the development build is not optimized.
- To create a production build, run npm run build.
-
- node:events:504
- throw er; // Unhandled 'error' event
- ^
-
- Error: spawn cmd ENOENT
- at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
- at onErrorNT (node:internal/child_process:478:16)
- at processTicksAndRejections (node:internal/process/task_queues:8Emitted 'error' event on ChildProcess instance at:
- at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
- at onErrorNT (node:internal/child_process:478:16)
- at processTicksAndRejections (node:internal/process/task_queues:83:21) {
- errno: -4058,
- code: 'ENOENT',
- syscall: 'spawn cmd',
- path: 'cmd',
- spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:9528/' ]
- }
显示下列报错
- node:events:504
- throw er; // Unhandled 'error' event
- ^
可以将vue.config.js文件中,
- devServer: {
- port: port,
- open: open,
- overlay: {
- warnings: false,
- errors: true
- },
- before: require('./mock/mock-server.js')
- },
将其中的: open:open,
改成: open:false,
该语句作用是告诉dev-server在服务器启动后打开浏览器,
改完以后就可以通过打开本地端口进行访问了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。