解决 Vue 报错:Vue packages version mismatch

612 阅读1分钟

一、问题

Vue 项目报错:

Vue packages version mismatch:

- vue@2.7.13 (/var/www/node_modules/vue/dist/vue.runtime.common.js)
- vue-template-compiler@2.7.15 (/var/www/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-loader 版本做升级处理依旧报错。

二、解决

保持 vuevue-template-compiler 版本一致即可,亲测有效。

三、参考

stackoverflow