youlaitech / vue3-element-admin

🔥基于 vue3 + vite5 + typescript + element-plus 构建的后台管理前端模板(配套后端源码),vue-element-admin 的 vue3 版本。
https://vue3.youlai.tech
MIT License
1.35k stars 359 forks source link

项目初始话失败,提示Vue packages version mismatch: #147

Closed liuyunchuan closed 3 weeks ago

liuyunchuan commented 3 months ago

我电脑是mac系统,npm是10.2.4, node 是18.19.1,报错之后,试过卸载vue-template-compiler(pnpm uninstall vue-template-compiler),并且安装sfc(pnpm install @vue/compiler-sfc@3.4.29),还是有这个报错,我应该如何解决。 2222222

haoxianrui commented 3 months ago

@liuyunchuan 目前 github 和这个相关的 issue 基本是 open 状态。 我看群里有人解决是 pnpm 残留了 vue 2.7 ,所以尝试清理 pnpm 的缓存或者卸载 pnpm 看看。 当前只是建议,目前我这边没有机器能够复现这个问题。有进展还希望告知下,感谢!

liuyunchuan commented 3 months ago

我通过全局搜索vue-template-compiler,发现只有在node_moules里面存在vue-template-compiler,并且存在2.6.12的版本和2.7.16版本。 image 删除node_moules 和 package-lock.json 后,全局搜索不到 vue-template-compiler 相关内容 image

运行pnpm install安装正常 image

运行pnpm list vue,只看的vue 3.4.29版本,没看到vue2 image 再次全局搜索vue-template-compiler,又出现了 image 看看我提供的这些信息能不能大概定位出问题,感谢!!!

haoxianrui commented 3 months ago

@liuyunchuan
升级 unplugin-icons 版本到 v0.19.0试试 https://github.com/unplugin/unplugin-icons/releases/tag/v0.19.0 image

liuyunchuan commented 3 months ago

升级 unplugin-icons 版本到 v0.19.0了,问题还是存在 image

image

image

image

liuyunchuan commented 3 months ago

好像是因为unplugin-icons 0.19.0 和 vue-tsc 2.0.21都有依赖 vue-template-compiler

image

haoxianrui commented 3 months ago

@liuyunchuan 很奇怪 , 我的机器无论 unplugin-icons 0.19.0 还是 旧版的 0.18.5 ,解析 vue-template-compiler 依赖时都没显示,所以问题应该还是出现在 unplugin-icons 组件上

haoxianrui commented 3 months ago

@liuyunchuan 试着移除 unplugin-icons 组件看下情况 image

liuyunchuan commented 3 months ago

找了一个windows的电脑,cmd那边没有报错信息,当时登录之后页面没有内容

![Uploading image.png…]()

![Uploading image.png…]()

liuyunchuan commented 3 months ago

image image

haoxianrui commented 3 months ago

@liuyunchuan 这又是另一个错误了,也是比较少见,都被你碰到了。wins 这台机器你试着打开自动导入组件重新生成 image