2023-06-12 运行旧的rouyi前端项目报错:unknown property 'disableHostCheck'
运行,报错
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 'disableHostCheck'. 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? }
原因:当前项目的配置文件版本太低,需要更新插件。
解决方案:我是这么做的:把旧的项目的package.json文件删掉,然后把rouyi官方最新的package.json文件替换回去,接着yarn,然后npm run build,成功运行。