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

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 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误