ERESOLVE unable to resolve dependency tree 作者:七棵菜 日期:2022-11-30 栏目:计算机分类:1 人气:608 ### 问题 npm下载包的时候,如果其依赖的其他包的版本和你本地已经安装的版本不一致会出现类似下面的提示: ``` $ npm install seven-food-form@2.0.6 npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! Found: seven-food-form@2.0.1 npm ERR! node_modules/seven-food-form npm ERR! seven-food-form@"2.0.6" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! seven-food-form@"2.0.6" from the root project npm ERR! npm ERR! Conflicting peer dependency: tslib@2.4.0 npm ERR! node_modules/tslib npm ERR! peer tslib@"^2.2.0" from seven-food-form@2.0.6 npm ERR! node_modules/seven-food-form npm ERR! seven-food-form@"2.0.6" 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\SZLD-PC-109\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\SZLD-PC-109\AppData\Local\npm-cache\_logs\2022-06-21T06_13_23_121Z-debug.log ``` 其实这不影响使用,我们仍然下载就行了,下载时添加参数`legacy-peer-deps`,如下 ``` npm install seven-food-form@2.0.6 --legacy-peer-deps ``` 标签: angular npm 上一篇:如何使用mvn命令导入依赖 下一篇:发布composer包的流程 随便看看 2024-02-19 PHP7 运算符“??” 和“?:”的区别 2022-11-30 Linux 后台运行命令 2022-11-25 关于我们 2022-11-30 centos一键系统安装lnmp集成环境 2022-11-30 linux 生成 ssh 公钥 留言