Vue packages version mismatch:VUE版本不匹配

报错

Vue packages version mismatch:
 
- [email protected] (/Users/dx/Documents/2021works/TaiTaiLeYingXiaoPC/node_modules/vue/dist/vue.runtime.common.js)
- [email protected] (/Users/dx/Documents/2021works/TaiTaiLeYingXiaoPC/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-template-compiler要和vue版本一致。
网上的方法有:node_modules文件和package.lock-json文件,然后将package.json文件中的vue版本号的 ^ 去除掉。再重新npm install。但不行。

我的解决方法是,先找到项目下的node_modules,删除vue-template-compiler,之后再运行 npm i [email protected]就解决了。

猜你喜欢

转载自blog.csdn.net/qq_43767886/article/details/130175276