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

查看:38
本文介绍了通过 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 installs angular 8.2.0-下一个.0

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

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