当前位置: 移动技术网 > IT编程>网页制作>Html5 > Vue packages version conflicts 错误修复

Vue packages version conflicts 错误修复

2018年11月26日  | 移动技术网IT编程  | 我要评论

我们在使用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 错误修复, 欢迎访问。

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网