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

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日

悬赏问题

  • ¥15 Stata链式中介效应代码修改
  • ¥15 latex投稿显示click download
  • ¥15 请问读取环境变量文件失败是什么原因?
  • ¥15 在若依框架下实现人脸识别
  • ¥15 添加组件无法加载页面,某块加载卡住
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用