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