vue.config.js中的错误无效选项:; baseurl;不允许
user@host:/var/www/abc/def/frontend# npm run serve
> [email protected] serve /var/www/abc/def/frontend
> vue-cli-service serve
ERROR Invalid options in vue.config.js: "baseUrl" is not allowed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-05-23T20_18_30_614Z-debug.log
user@host:/var/www/abc/def/frontend# npm run serve
> [email protected] serve /var/www/abc/def/frontend
> vue-cli-service serve
ERROR Invalid options in vue.config.js: "baseUrl" is not allowed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-05-23T20_18_30_614Z-debug.log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是编码问题,问题在于,Vue UI仍将baseurl添加到保存中的VUE配置文件中,但已弃用并由publicPath替换。
因此,由于已弃用它,Vue CLI将通过其自己生成的文件^^创建错误。
可以通过更改VUE UI来轻松修复这一点,以通过
publicPath
而不是baseurl
更新VUE Config File。source
This is not a coding issue, the problem is that vue ui still adds baseUrl to the vue config file on save, but it has been deprecated and replaced by publicPath.
So because it is deprecated, vue cli will create an error by its own generated file ^^.
This can easily be fixed by changing vue ui to update vue config file by
publicPath
instead ofbaseUrl
.Source