通过 CLI 以正确的方式更新 Angular 及其依赖项

Update Angular and its dependencies via CLI the proper way

我正在使用 Angular 8,但大多数时候我都面临着如下所示的不兼容对等依赖项的问题。我想知道最好的方法是什么?

ng update --all

Package "ngx-cookie-service" has an incompatible peer dependency to "@angular/core" (requires ">=4.2.0", would install "9.0.0-next.5").

Package "ngx-cookie-service" has an incompatible peer dependency to "@angular/platform-browser-dynamic" (requires ">=4.2.0", would install "9.0.0-next.5").

Package "ngx-cookie-service" has an incompatible peer dependency to "@angular/platform-browser" (requires ">=4.2.0", would install "9.0.0-next.5").

Package "@auth0/angular-jwt" has an incompatible peer dependency to "@angular/common" (requires ">=6.0.0", would install "9.0.0-next.5").

我所做的是强制更新 ng update --all --force,但我确信有更好的方法来做到这一点。当我强制更新时,我需要更改 packages.json 文件中的 TypeScript 版本。版本往往太“高级”

有时使用 ng update @angular/material 一一更新依赖项是有效的(并非所有时间)。

有什么想法吗?

这是 Angular CLI 中的一个未解决的错误。

在此处查看问题:ng update @angular/cli installs angular 8.2.0-next.0