【发布时间】:2021-01-11 17:08:27
【问题描述】:
我使用
设置了一个新的 Vue 3.0 应用程序vue create
然后我将 apollo 添加到我的应用程序中使用
vue add apollo
然后当我运行npm run build 时出现以下错误
ERROR Failed to compile with 2 errors
Module Error (from ./node_modules/vue-loader/lib/index.js):
Vue packages version mismatch:
- vue@3.0.0 (C:\workspace\StatusTool\dummy-project\node_modules\vue\index.js)
- vue-template-compiler@2.6.12 (C:\workspace\StatusTool\dummy-project\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.
Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'parseComponent' of undefined
at parse (C:\workspace\StatusTool\dummy-project\node_modules\@vue\component-compiler-utils\dist\parse.js:15:23)
at Object.module.exports (C:\workspace\StatusTool\dummy-project\node_modules\vue-loader\lib\index.js:67:22)
我做错了什么?
版本信息:
- @vue/cli: 4.5.6
- vue-cli-plugin-apollo:“0.22.2”
- 阿波罗:2.31.0
好像没有安装 vue-apollo 包
【问题讨论】:
-
vue-apollo 版本是多少?
-
为问题添加了版本信息。在已安装包列表中找不到 vue-apollo。
标签: vue.js vue-apollo vuejs3