成功解决:Module build failed: Error: Vue packages version mismatch

装Avue的后续一系列骚操作、最后项目都启动不成功。特此记录

1、运行项目报错信息

Module build failed: Error: 

Vue packages version mismatch:

- [email protected] (G:\workspace\BookShopManageVue\node_modules\vue\dist\vue.runtime.common.js)
- [email protected] (G:\workspace\BookShopManageVue\node_modules\[email protected]@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.

2、报错原因

版本问题、

当前安装的VUE依赖node_modules是2.6.14版本的,但导入的项目中用的是2.7.10版本的。

只要将两者的版本统一就行。

提示:如何统一版本。是下载安装2.6.14版本。还是2.7.10版本???

If you are using vue-loader@>=10.0, simply update vue-template-compiler.
如果您使用的是vue loader@>=10.0,只需更新vue模板编译器即可。

package-lock.json中查看vue loader的版本。我的vue loader 版本高于10。所以我要统一1.6.14版本。(我之前没看vue loader 直接下载安装的2.7.10版本。结果是同样的错误)
在这里插入图片描述

3、解决方法

  • 1、删除掉node_modules
  • 2、安装npm install [email protected] --save (需要查看版本)

4、成功运行

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43304253/article/details/126848483