0

我的角度版本: 在此处输入图像描述

npm install 解决不了问题,我的 npm 版本是 7.12.0

我试图运行npm install @kolkov/ngx-gallery --save安装 ngx-gallery,它给了我以下错误



npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: tesisclient@0.0.0
npm ERR! Found: tslib@2.3.0
npm ERR! node_modules/tslib
npm ERR!   tslib@"^2.0.0" from the root project
npm ERR!   tslib@"^2.0.0" from @angular/common@10.1.6
npm ERR!   node_modules/@angular/common
npm ERR!     @angular/common@"~10.1.4" from the root project
npm ERR!     peer @angular/common@">=8.0.0" from @kolkov/ngx-gallery@1.2.3
npm ERR!     node_modules/@kolkov/ngx-gallery
npm ERR!       @kolkov/ngx-gallery@"*" from the root project
npm ERR!   1 more (@angular/core)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer tslib@"^1.9.3" from @kolkov/ngx-gallery@1.2.3
npm ERR! node_modules/@kolkov/ngx-gallery
npm ERR!   @kolkov/ngx-gallery@"*" 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\Armando\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\Armando\AppData\Local\npm-cache\_logs\2021-07-24T20_05_07_708Z-debug.log



4

3 回答 3

0
npm config set legacy-peer-deps true

如果这个不起作用,您可以参考这些文档并尝试这些命令 https://www.codegrepper.com/code-examples/whatever/npm+ERR%21+code+ERESOLVE+npm+ERR%21+ERESOLVE+unable+到+解决+依赖+树

于 2021-07-25T19:14:35.687 回答
0

这可能有很多原因,我建议将 Node.js 更新到当前的最新版本14.17.3

如果问题仍然存在,请运行此命令

npm install --save --legacy-peer-deps
于 2021-07-24T20:58:38.027 回答
0

通过以下命令安装

npm install @kolkov/ngx-gallery --force

请参阅下面的 Github 参考链接。 https://github.com/kolkov/ngx-gallery/issues/77

于 2021-12-13T11:45:42.213 回答