当前位置:   article > 正文

Error loading vue.config.js: ERROR TypeError: defineConfig is not a function解决方法_error error loading vue.config.js: error typeerror

error error loading vue.config.js: error typeerror: defineconfig is not a fu
const {defineConfig} = require('@vue/cli-service')
module.exports = defineConfig({
    transpileDependencies: true,
    devServer: {
        port: 8081
    }
})
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

百度搜出来的博客说是vue-cli版本太低了,然后瞎升级了半天

  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.15",
    "@vue/cli-plugin-router": "~4.5.15",
    "@vue/cli-service": "~4.5.15",
  }
  • 1
  • 2
  • 3
  • 4
  • 5

给百度坑惨了,4.5的cli已经对应vue3了
正确解法还得看StackOverflow
在这里插入图片描述

如果不是用的vite,还是老写法

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/288557
推荐阅读
相关标签
  

闽ICP备14008679号