【发布时间】:2021-09-13 22:15:58
【问题描述】:
我经常收到类似于下面的错误 ERESOLVE。你是怎么读的?
>npm audit fix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myapp@0.0.0
npm ERR! Found: @angular/compiler@12.1.0
npm ERR! node_modules/@angular/compiler
npm ERR! @angular/compiler@"12.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.1.1" from @angular/compiler-cli@12.1.1
npm ERR! node_modules/@angular/compiler-cli
npm ERR! dev @angular/compiler-cli@"^12.1.0" from the root project
npm ERR! peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/build-angular@12.1.0
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR! dev @angular-devkit/build-angular@"12.1.0" from the root project
您如何阅读它 - 哪个包取决于哪个?我可以控制树的哪一端?顶部还是底部?
我是否在我的应用程序中添加了 @angular-devkit/build-angular 并且它需要但找不到 angular/compiler ?还是相反?
【问题讨论】:
-
您似乎遇到了依赖冲突(不正确且可能损坏的依赖)问题,尝试使用
--force或--legacy-peer-deps运行命令,例如:npm audit fix --force。如果不生效,临时解决办法是使用节点的旧版本(降级节点版本),因为它有时会导致发生此类错误。参考:Unable to resolve dependency tree error when installing npm packages. -
这不是我真正需要的。我编辑了问题..
标签: node.js angular asp.net-core npm