VUE报错:Vue packages version mismatch

1. Vue packages version mismatch:

\  Building for production... ERROR  Error: 

Vue packages version mismatch:

- vue@3.4.15 (D:\code\XXX\XXX\node_modules\vue\index.js)
- vue-template-compiler@2.7.16 (D:\code\XXX\XXX\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

原因:
vue与 vue-template-compiler版本不匹配
解决:
降低vue版本
npm install vue@2.7.16 --force
或者升级vue-template-compiler(这个目前不知道怎么做,虚心求教)
因为vue3.X不再使用 vue-template-compiler
更改vue-template-compiler版本命令
先卸载:npm uninstall vue-template-compiler
再安装npm install vue-template-compiler@2.7.16 --force

2."export ‘createElementBlock’ (imported as ‘$e’) was not found in ‘vue’

-  Building for production...

 ERROR  Failed to compile with 4 errors                                                                                                     上午10:08:09

 error  in ./node_modules/v-viewer/dist/index.mjs

"export 'createElementBlock' (imported as '$e') was not found in 'vue'

 error  in ./node_modules/v-viewer/dist/index.mjs

"export 'openBlock' (imported as 'Te') was not found in 'vue'

 error  in ./node_modules/v-viewer/dist/index.mjs

"export 'render' (imported as 'G') was not found in 'vue'

 error  in ./node_modules/v-viewer/dist/index.mjs

"export 'renderSlot' (imported as 'Oe') was not found in 'vue'

原因:
vue版本低了,需要升级到3.X

  • 14
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值