Vue packages version conflicts 錯誤修復

咱們在使用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

相關文章
相關標籤/搜索