m0_65213775 2022-04-20 19:27 采纳率: 90.5%
浏览 3020
已结题

vue3,报错Error loading vue.config.js

在vue3,div中使用slot,然后正常serve报错

报错内容
Error loading vue.config.js:
ERROR TypeError: defineConfig is not a function
TypeError: defineConfig is not a function
at Object. (D:\vscode\Vue-01\supermall\vue.config.js:2:18)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Service.loadUserOptions (D:\vscode\Vue-01\supermall\node_modules@vue\cli-service\lib\Service.js:301:22)
at Service.init (D:\vscode\Vue-01\supermall\node_modules@vue\cli-service\lib\Service.js:73:30)
at Service.run (D:\vscode\Vue-01\supermall\node_modules@vue\cli-service\lib\Service.js:206:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! supermall@0.1.0 serve: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the supermall@0.1.0 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! C:\Users\win10\AppData\Roaming\npm-cache_logs\2022-04-20T11_24_19_592Z-debug.log

基本上把所有的版本都重装了一边,还是报错

  • 写回答

1条回答 默认 最新

  • 小蓝阿姨 2022-04-20 20:50
    关注

    目前猜测你脚手架版本太低
    先把vue-cli的脚手架更新一下看看情况
    npm i -g @vue/cli

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 5月31日
  • 已采纳回答 5月23日
  • 创建了问题 4月20日

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改