Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-pe

今天在执行 npm i 的时候报了以上错误
报错原因是:
使用的npm版本是7.20.0,npm7对peerDependencies要求严格,npm6允许通过的部分不再允许通过。
解决方法:
使用以下两个参数忽略,或者直接继续使用npm6。
npm install --legacy-peer-deps
npm install --force
本文介绍了在执行npm install时遇到的上游依赖冲突问题,由于npm 7对peerDependencies的严格要求,导致一些原本在npm 6中可以安装的包现在无法正常安装。解决方法包括使用`npm install --legacy-peer-deps`或`npm install --force`参数来忽略冲突。建议根据项目需求选择合适的npm版本或采用指定参数进行安装。

2934

被折叠的 条评论
为什么被折叠?



