ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
运行别人的vue项目时,先使用npm install命令,再使用npm run serve命令。
在使用npm run serve命令时报错,错误如下:

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 ‘disableHostCheck’. These properties are valid:
    object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetup
    Middleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

解决方法如下:
注释这一行即可
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐