咱们在使用Vue做为weex中的前端框架的开发过程当中,某次 npm start
遇到了以下的错误:html
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
:vue
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已经开源了至关一段时间,但社区不够活跃。这一点,能够从遇到问题搜索出来的有效内容数量很少看出。所以,遇到问题的时候,须要具有分析问题产生根本缘由的能力。同时,也要多分享,但愿能够遇到更多志同道合的人。node
本文已同步至:Vue packages version conflicts 错误修复, 欢迎访问。npm