npm报错

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

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

bash 复制代码
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
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 [email protected]
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,跑成功了,继续学

相关推荐
啪叽1 分钟前
JavaScript可选链操作符(?.)的实用指南
前端·javascript
Ian在掘金2 分钟前
bat+python实现easy connect自动连接
前端·python
代码搬运媛4 分钟前
【react实战】如何实现监听窗口大小变化
前端·javascript·react.js
小桥风满袖6 分钟前
Three.js-硬要自学系列30之专项学习环境光
前端·css·three.js
Luckyfif9 分钟前
🤯由 性能指标 散发开来的 Performance API 被问爆了呀
前端·面试·性能优化
咸虾米12 分钟前
在uniCloud云对象内使用unipay的微信退款出现错误“uniPayCo.refund Error: token校验未通过”的解决方案
前端·后端
前端Hardy19 分钟前
HTML&CSS:产品卡片动画效果
前端·javascript
货拉拉技术24 分钟前
货拉拉开源:鸿蒙路由 TheRouter
android·前端·harmonyos
中杯可乐多加冰26 分钟前
工业4.0数字孪生新引擎:星图云开发者平台全景评测
前端·低代码·掘金·金石计划
云边小卖铺.33 分钟前
运行vue项目报错 errors and 0 warnings potentially fixable with the `--fix` option.
前端·javascript·vue.js