我有项目在角度8与metronic后,上升到角10,当我试图安装npm I时,每次得到这个错误。
npm ERR! While resolving: metronic-angular@6.1.8
npm ERR! Found: @angular/common@10.2.5
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: metronic-angular@6.1.8
npm ERR! Found: @angular/common@10.2.5
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"^10.2.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^8.0.0 || ^9.0.0-0" from @angular/cdk@8.2.3
npm ERR! node_modules/@angular/cdk
npm ERR! @angular/cdk@"^8.2.3" 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.这是截图

如有任何帮助,将不胜感激。
发布于 2022-04-01 15:55:24
请把package.json附上去好吗?看起来@angular/cdk还没有增加到v10。我最近有一个类似的问题,同时更新的角度,甚至正确的版本指定。我以下列方式固定:
可以通过命令rm -rf node_modules
npm install执行
https://stackoverflow.com/questions/71708262
复制相似问题