如何更改(升级或降级)Angular版本? [英] How to Change (Upgrade or Downgrade) Angular version?

查看:1339
本文介绍了如何更改(升级或降级)Angular版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了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?

答案: 项目中使用的angular版本取决于所安装的cli版本. 可以使用以下命令安装任何特定版本的cli cli:

Answer: 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

即使您安装了不会引起问题的其他版本的cli(新旧版本).

even if you have another version of angular cli (either newer or older) installed that won't cause issues.

推荐答案

我将尝试为以后的类似问题提供一个一般性的答案.

I will try to give a general answer for future similar issues.

项目中使用的angular版本取决于所安装的cli版本.可以使用以下命令安装任何特定版本的cli 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

即使您安装了另一个角度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 cache clean

npm install -g angular-cli@1.6.1

这篇关于如何更改(升级或降级)Angular版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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