Vue packages version conflicts 错误修复

我们在使用Vue作为weex中的前端框架的开发过程中,某次 npm start 遇到了如下的错误:

Vue packages version mismatch: - vue@2.5.16 - vue-template-compiler@2.5.13 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 的版本,然后更新 vue-template-compiler:

npm install vue-template-compiler@2.5.16 -g

但是,再次start后仍然遇到相同的错误。搜索后,有人提示重新安装weex toolkit等方法。很遗憾,尝试过重装后还是有该问题。
稍一思索,猜测应该是weex中使用到的module版本和全局安装的module不是同一个。于是,检查安装的weex module,在weex-toolkit下的 node_modules 中发现了weex-builder。然后继续在该文件夹下的 node_modules中找到 vue-template-compiler,发现其版本确实是 2.5.13。相应的解决方法是把全局安装的 vue-template-compiler module复制到 weex-builder下。 最终,问题解决。
虽然weex已经开源了相当一段时间,但社区不够活跃。这一点,可以从遇到问题搜索出来的有效内容数量不多看出。因此,遇到问题的时候,需要具备分析问题产生根本原因的能力。同时,也要多分享,希望可以遇到更多志同道合的人。

 

本文已同步至:Vue packages version conflicts 错误修复, 欢迎访问。

 

posted on 2018-11-25 17:14  scorpiozj  阅读(616)  评论(0编辑  收藏  举报