当我第一次做npm install
时,我得到了一堆警告,下面只是一个例子
@angular/animations@7.2.10 requires a peer of @angular/core@7.2.10 but none is installed. You must install peer dependencies yourself.
(...在此跳过其他警告...)
npm WARN angular-star-rating@4.0.0-beta.3 requires a peer of @angular/core@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-star-rating@4.0.0-beta.3 requires a peer of @angular/forms@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
看到此警告后,我更新了package.json
并修改了{angular / core 7.2.8 to 7.2.10
,然后进行了npm install
。第二次跑步给了我低于警告的声音
@angular/forms@7.2.8 requires a peer of @angular/core@7.2.8 but none is installed. You must install peer dependencies yourself.
在这种情况下我该怎么办?
@angular/animations@7.2.10 needs @angular/core@7.2.10
@angular/forms@7.2.8 needs @angular/core@7.2.8.
@angular-star-rating@4.0.0-beta.3 requires @angular/core@^4.0.0
如何处理? 我是否应该将表格真正更新为@ angular / forms @ 7.2.10? 我应该手动更新每个损坏的依赖项吗?
答案 0 :(得分:0)
对于@ angular /项目,由于潜在的兼容性问题,通常最好一次同时更新它们。
Angular更新指南也非常有帮助。签出可帮助您完成此过程的Angular CLI工具。 https://update.angular.io/