vue.config.js中的错误无效选项:; baseurl;不允许

发布于 2025-01-31 09:28:48 字数 983 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

四叶草在未来唯美盛开 2025-02-07 09:28:48

这不是编码问题,问题在于,Vue UI仍将baseurl添加到保存中的VUE配置文件中,但已弃用并由publicPath替换。

因此,由于已弃用它,Vue CLI将通过其自己生成的文件^^创建错误。

可以通过更改VUE UI来轻松修复这一点,以通过publicPath而不是baseurl更新VUE Con​​fig 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 of baseUrl.

Source

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文