编译weex项目时, 一直提示“Vue packages version mismatch”
Vue packages version mismatch:
- vue@2.4.4
- 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跟vue-template-compiler版本不一致
但是package.json里边配置的vue和vue-template-compiler的版本配置是一样的
有可能是vue污染,终极解决办法如下
使用以下两个命令修复下
weex xbind repair toolkit-repair
weex repair
bogon:mi-frontend devenzhao$ weex xbind repair toolkit-repair
Set commands = "[{"name":"repair","package":"npm:toolkit-repair"}]"
bogon:mi-frontend devenzhao$ weex repair
This command need to install toolkit-repair. Installing...
检测环境中...
环境正常!
检测是否有不匹配的vue污染...
search: /Users/devenzhao/.xtoolkit
发现版本不匹配的vue污染: /node_modules/vue/dist/vue.runtime.common.js
卸载中...
16:17:26 : Error: 检测到vue被装在了根目录,本工具权限不够,请加sudo执行
bogon:mi-frontend devenzhao$ sudo weex repair
Password:
检测环境中...
环境正常!
检测是否有不匹配的vue污染...
search: /Users/devenzhao/.xtoolkit
发现版本不匹配的vue污染: /node_modules/vue/dist/vue.runtime.common.js
卸载中...
removed 1 package in 0.13s
修复完成