通过CLI以正确方式更新Angular及其依赖项 [英] Update Angular and its dependencies via CLI the proper way

查看:337
本文介绍了通过CLI以正确方式更新Angular及其依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Angular 8,并且在大多数情况下,我会遇到如下问题,即不兼容的对等项依赖关系.我想知道什么是最好的方法?

I'm using Angular 8 and I'm facing most of the time an issue like below with incompatible peer dependencies. I'm wondering what's the best way to do?

ng update --all

打包"ngx-cookie-service"对"@ angular/core"具有不兼容的对等项依赖关系(要求> = 4.2.0&",将安装"9.0.0-next.5").

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

打包"ngx-cookie-service"对"@ angular/platform-b​​rowser-dynamic"具有不兼容的对等依赖性. (要求> = 4.2.0&",将安装"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").

打包"ngx-cookie-service"对"@ angular/platform-b​​rowser"具有不兼容的对等项依赖关系(要求> = 4.2.0&",将安装"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").

包"@ auth0/angular-jwt"对"@ angular/common"具有不兼容的对等项依赖关系(要求> = 6.0.0&",将安装"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版本.该版本通常过于高级"

What I do is forcing the update ng update --all --force but I'm sure there is a better way to do it. When I force update I need to change the TypeScript version in packages.json file. The version is often too "advanced"

例如,有时可以用ng update @angular/material逐一更新依赖关系(并非总是如此).

Sometimes updating dependencies one by one with ng update @angular/material for example works (not all the time).

有什么主意吗?

推荐答案

这是Angular CLI中的一个开放错误.

This is an open bug in the Angular CLI.

在此处查看问题: ng update @ angular/cli安装有角8.2.0- next.0

这篇关于通过CLI以正确方式更新Angular及其依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆