vue创建项目报错显示vue 和 vue-template版本不同

 既然是版本不一致,那么只需要把vue与vue-template-compiler的版本更新为一致的就行了

第一种办法:

更新vue-template-compiler到与vue同版本

把vue-template-compiler卸载(cnpm uninstall vue-template-compiler),

再重新安装一个与vue版本一致的vue-template-compiler(cnpm install vue-template-compiler@报错中提示的vue-template-compiler的版本号,这里是2.6.10  )

但是我发现这个办法并行不通,还是报相同的错误

第二种办法:

更新vue到与vue-template-compiler同版本

cnpm install vue@2.6.10 --save

如果安装后还是出现相同的报错,有可能是vue的安装与运行环境不符,可尝试加上 `-g` 再装一遍

cnpm install vue@2.6.10 --save -g

原文地址:https://www.cnblogs.com/xiongying4/p/12288451.html