ng update to specific Angular version

前端 未结 5 1080
感情败类
感情败类 2020-12-18 18:13

I would like to update Angular from version 5.0 to version 6.1. The instructions at https://update.angular.io/ suggest using ng update @angular/core to update.

5条回答
  •  一向
    一向 (楼主)
    2020-12-18 18:33

    You can use the @ symbol to specify the version on each package desired. The currently recommend approach to upgrading Angular to a newer version (or version you dictate) is to use the following command:

    ng update @angular/cli @angular/core
    

    In this case let's say I wanted to upgrade to 8.1.1 instead of the latest version of 8.2.0 I would use the following:

    ng update @angular/cli@8.1.1 @angular/core@8.1.1
    

    This is the same way you specify a specific version when doing any npm installs as explained here.

提交回复
热议问题