好记性不如烂笔头,初次学习weex,记录一下学习中遇到的问题。
在使用weex编译写好的.vue文件或.we文件时提示包版本不匹配错误:
ERR! [webpack errors]
Vue packages version mismatch:
- vue@2.2.6
- vue-template-compiler@2.2.4
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、使用修复命令:weex repair ,2、在项目路径下使用命令重新安装:npm install,3、重新编译你的文件。如果不能解决请按步骤重新使用。
使用修复命令:
weex repair
首次使用会提示是否现在安装修复工具,yes就行,等提示修复完成后
在你的项目路径使用命令下重新安装:
npm install
之后再编译文件就能完成。