如何更改(升级或降级)Angular 版本? [英] How to Change (Upgrade or Downgrade) Angular version?
问题描述
我最近安装了 Angular 6,并想重新使用 Angular 5.2如何将我的 Angular 版本从我拥有的任何版本更改为我选择的任何一个?
I have recently installed Angular 6 and would like to go back to using Angular 5.2 How can I change my Angular version from whatever version I have to whichever one I choose?
推荐答案
我会尽量为以后的类似问题给出一个通用的答案.
I will try to give a general answer for future similar issues.
项目中使用的 angular 版本由安装的 angular cli 版本决定.可以使用以下命令安装任何特定版本的 angular cli:
The version of angular used in a project is determined by the version of angular cli installed. Any specific version of angular cli can be installed with the following command:
npm install --global @angular/cli@x.x.x.
示例:
npm install --global @angular/cli@1.6.6
即使您安装了另一个版本的 angular cli(新的或旧的).这不应该引起问题.但是请确保您可以使用:
even if you have another version of angular cli (either newer or older) installed. That should not cause issues. However to be sure you can use:
npm uninstall -g angular-cli
npm 缓存清理
npm install -g angular-cli@1.6.1
这篇关于如何更改(升级或降级)Angular 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!