Vue packages version mismatch解决方案

在工作台创建一个vue/cli3的项目,vue create 项目名称,报错信息如下:

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
还是没成功~~~

最后发现是之前vue-cli2的版本没清除干净,找到vue.runitme.common.js这个文件删除它(根据报错里提示的路径)
成功!!!

猜你喜欢

转载自www.cnblogs.com/shemingxin/p/12466633.html