首页 > 解决方案 > 尝试创建 Vue 项目时如何修复版本不匹配错误?

问题描述

我正在尝试使用简单地创建一个 vue 项目,vue create shop但不断收到此错误消息:

Error: 

Vue packages version mismatch:

- vue@2.6.11 (/home/roy/.config/yarn/global/node_modules/vue/dist/vue.runtime.common.js)
- vue-template-compiler@2.6.10 (/home/roy/.config/yarn/global/node_modules/vue-jscodeshift-adapter/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 install vue-template-compiler --save-dev了,但这似乎并没有改变任何东西。

标签: vue.js

解决方案


在键入此内容时,我发现这yarn global upgrade适用于我的情况


推荐阅读