npm报错

最近想看看新东西,就去github上找了个项目边做边学

结果在第一步npm install就遇上了问题

bash 复制代码
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: blog-vue-ts-vite@0.0.0
npm ERR! Found: vue@3.4.27
npm ERR! node_modules/vue
npm ERR!   vue@"^3.4.27" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"3.1.x" from element-plus@1.0.2-beta.71
npm ERR! node_modules/element-plus
npm ERR!   element-plus@"^1.0.2-beta.71" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

在运行 npm install 时遇到了依赖冲突的错误,这是因为 vue 和 element-plus 的版本不兼容。

powershell 复制代码
npm install vue@^3.4.27
npm install element-plus@^2.0.0
npm install vue-router@^4.3.2

改一改版本就好了,OK,跑成功了,继续学

相关推荐
liangshanbo121517 分钟前
面试题:前端工程化中 Tree Shaking的原理是什么?
前端·treeshaking
补码缩写1 小时前
视频跳转触发了seeked,画面就到位了吗
前端
库拉镜像AI牛牛1 小时前
漫剧工作室量产方案:依托知漫剧 AI 短剧降本增效
大数据·服务器·前端·人工智能·语音识别
不可能片场1 小时前
内容运营自动化 用相似度拦住撞车选题
前端·electron
静默回滚1 小时前
视频进度条跳回去,先别改事件监听
前端
Lank_M1 小时前
MP4和WebM导出后为何起播与拖动不同
前端
用户5508492902561 小时前
前端本地存储怎么选:Cookie、localStorage、sessionStorage、IndexedDB 的取舍
前端
用户5508492902561 小时前
Git 日常命令与分支协作流程:从提交到合并的实战梳理
前端
修炼的dance1 小时前
同一段视频没降画质为什么就快了
前端
asong2 小时前
从写代码到部署上线,Cloudflare 给 AI 配了一把新钥匙
前端·javascript·后端