npm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolvenpm ERR!-解决

PS F:\work\adapt-portal-web-mobile> npm install

npm ERR! code ERESOLVE

npm ERR! ERESOLVE could not resolve

npm ERR!

npm ERR! node_modules/compression-webpack-plugin

npm ERR! dev compression-webpack-plugin@"^10.0.0" from the root project

npm ERR!

npm ERR! Conflicting peer dependency: webpack@5.88.2

npm ERR! node_modules/webpack

npm ERR! peer webpack@"^5.1.0" from compression-webpack-plugin@10.0.0

npm ERR! node_modules/compression-webpack-plugin

npm ERR! dev compression-webpack-plugin@"^10.0.0" 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 ERR! See C:\Users\yjtzf\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\yjtzf\AppData\Local\npm-cache\_logs\2023-10-12T01_21_07_673Z-debug-0.log

解决方法

bash 复制代码
npm install --legacy-peer-deps

'npm install --legacy-peer-deps'命令允许你安装一个包,即使该包的peer依赖关系没有满足。在npm 7及以上版本中,npm默认行为是对peer依赖进行验证。如果peer依赖没有满足,npm会拒绝安装。而使用'--legacy-peer-deps'标志,可以改变这种行为,即使peer依赖没有满足也可以完成安装。但是,这可能会导致某些功能不工作或者出现其他问题,因此只有在你确定知道你在做什么的情况下才使用这个命令。

相关推荐
原则猫2 小时前
HOOKS 背后机制
前端
码语智行2 小时前
首页导航跳转功能深度解析-系统内和系统外
前端
阿猫的故乡3 小时前
Vue过渡动画从入门到装X:淡入淡出、滑动、列表动画、第三方库全搞定
前端·javascript·vue.js
IManiy3 小时前
总结之Vibe Coding前端骨架
前端
JS菌3 小时前
AI Agent 沙箱双层防护体系:从权限过滤到内核隔离的完整实现
前端·人工智能·后端
Aphasia3113 小时前
从输入URL到页面展示全流程
前端·面试
我叫黑大帅4 小时前
前端如何竖屏固定视口背景
前端·javascript·面试
abcy0712134 小时前
python pandas csv异步后台清洗前端优先返回成功信息
前端·python·pandas
IT_陈寒4 小时前
Vite这个坑我帮你踩了,动态导入居然这样才生效
前端·人工智能·后端
swipe4 小时前
Mem0 x Agent 实战系列:分层记忆 + 三路召回,搭建真正可用的长期记忆层
前端·javascript·面试