解决vue和vue-template-compiler版本不一致问题
解决Vue和Vue-template-complier版本不一样问题
·
在工作台创建一个vue的项目,vue create 项目名称,出现报错信息:
ERROR Error:
Vue packages version mismatch:
vue@2.6.10 (D:\softwares\node\node_global\node_modules\vue\dist\vue.runtime.common.js)
vue-template-compiler@2.6.11 (D:\softwares\node\node_global\node_modules@vue\cli\node_modules\vue-template-compiler\package.json)
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-cli2的版本没清除干净,找到vue.runitme.common.js这个文件删除它(根据报错里提示的路径)
下方中红方框圈起来的便是(报错里提示的路径、不同人的提示路径可能有所不同请留意):
并执行下面操作:
第一步:执行npm uninstall vue-template-compiler
第二步:执行npm install vue-template-compiler@报错中提示的vue的版本号
下方中红方框圈起来的便是(报错中提示的vue的版本号):
更多推荐
已为社区贡献1条内容
所有评论(0)