简体   繁体   English

npm 不安装无法解析依赖树

[英]npm not installing unable to resolve dependency tree

Actually, I have a working project in angular but right now I am just trying to revamp the project So I install the npm on this project using npm install command but I got the bellow error.实际上,我在 angular 中有一个工作项目,但现在我只是想改造该项目所以我使用npm install命令在该项目上安装 npm,但出现以下错误。 Please check the screenshot请检查屏幕截图

在此处输入图像描述

Please help me to reach out this issue请帮我解决这个问题

By reading the errors, it seems like the selected-country@^5.0.1 needs @angular/cdk@~12.x , but you only have @angular/cdk@^10.2.3通过阅读错误,似乎selected-country@^5.0.1需要@angular/cdk@~12.x ,但你只有@angular/cdk@^10.2.3

You might want to try this:你可能想试试这个:

npm update @angular/cdk@12

This basically will try to update your angular/cdk to version 12.这基本上会尝试将您的angular/cdk更新到版本 12。

If this doesn't work.如果这不起作用。 You can also try downgrading your Node.js to a lower version.您也可以尝试将您的 Node.js 降级到较低版本。 I had to also downgrade my Node.js when I updated my entire Angular project from version 12 to 13.当我将整个 Angular 项目从版本 12 更新到版本 13 时,我还必须降级我的 Node.js。

If this still doesn't work, you can try out these methods answered by our community.如果这仍然不起作用,您可以尝试我们社区回答的这些方法。

Unable to resolve dependency tree error when installing npm packages 安装 npm 包时无法解决依赖树错误

Try npm install --legacy-peer-deps试试npm install --legacy-peer-deps

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM