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

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 fastreport怎么判断当前页数
  • ¥15 Kylin-Desktop-V10-GFB-Release-JICAI_02- 2207-Build14-ARM64.iso有没有这个版本的系统啊
  • ¥15 能不能通过蓝牙将传感器数据传送到手机上
  • ¥20 100元python和数据科学实验项目
  • ¥15 根据时间在调用出列表
  • ¥15 R 包chipseeker 安装失败
  • ¥15 Veeam Backup & Replication 9.5 还原问题
  • ¥15 vue-print-nb
  • ¥15 winfrom的datagridview下拉框变成了黑色,渲染不成功
  • ¥20 利用ntfy实现短信推送