npm run serve无法启动

来源:2-5 获取轮播图接口数据

qq_心软只会背叛了自己_0

2024-11-05

无法启动,这是啥原因啊!各位大佬求助

E:\前端学习\vue3项目学习\vue-music-first\vue-music-first>npm run serve


> vue-music-first@0.1.0 serve

> vue-cli-service serve


 INFO  Starting development server...

 ERROR  ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

         - options has an unknown property 'before'. These properties are valid:

           object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

 - options has an unknown property 'before'. These properties are valid:

   object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

    at validate (E:\前端学习\vue3项目学习\vue-music-first\vue-music-first\node_modules\webpack-dev-server\node_modules\schema-utils\dist\validate.js:158:11)

    at new Server (E:\前端学习\vue3项目学习\vue-music-first\vue-music-first\node_modules\webpack-dev-server\lib\Server.js:270:5)

    at serve (E:\前端学习\vue3项目学习\vue-music-first\vue-music-first\node_modules\@vue\cli-service\lib\commands\serve.js:194:20)

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)


写回答

2回答

ustbhuangyi

2024-12-26

可能是你的 vue config 版本的问题吧?你现在可以尝试用 vite 开发

0
1
qq_心软只会背叛了自己_0
好的,谢谢老师🙏🏻!我先降低版本试试吧,不行再尝试换vite开发
2024-12-27
共1条回复

我就学个习

2024-12-20

+1我也是这个问题

0
0

Vue3开发企业级音乐Web App 明星讲师带你学大厂代码

慕课网明星讲师黄轶深度讲解 Vue3.0 ,提升的不止是Vue代码能力

2229 学习 · 1010 问题

查看课程