当前位置:   article > 正文

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

module build failed

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

1、运行项目报错信息

Module build failed: Error: 

Vue packages version mismatch:

- vue@2.6.14 (G:\workspace\BookShopManageVue\node_modules\vue\dist\vue.runtime.common.js)
- vue-template-compiler@2.7.10 (G:\workspace\BookShopManageVue\node_modules\_vue-template-compiler@2.7.10@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.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

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 vue@2.6.14 --save (需要查看版本)

4、成功运行

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/450819
推荐阅读
相关标签
  

闽ICP备14008679号