vue与vue-template-compiler版本号不一致

报错信息为:
ERROR Error:

Vue packages version mismatch:

  • [email protected] (D:\softwares\node\node_global\node_modules\vue\dist\vue.runtime.common.js)
  • [email protected] (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.

解决方法:
npm uninstall vue-template-compiler //卸载掉已经安装的版本
npm i vue-template-compiler@当前版本号 --save //这里的版本号是当前vue的版本号
不行,没成功。
换一种方法:
npm install
npm update
还是不行!透= =继续找办法,最后发现是之前vue2.0的版本没清除干净,那就找到vue.runitme.common.js然后删除它就完事了(根据报错里提示的路径,本机为:D:\softwares\node\node_global\node_modules\vue\dist\vue.runtime.common.js)。
好了成功。

猜你喜欢

转载自www.cnblogs.com/ldyy/p/12362039.html
今日推荐