LoginSignup
8
3

More than 3 years have passed since last update.

ng updateでAngularのバージョンを指定してバージョンアップする

Last updated at Posted at 2019-06-29

次のようにng updateを使いAngularアプリケーションおよびその依存関係諸々のアップデートを行うと、最新のバージョンにアップデートされます。

ng update @angular/cli @angular/core

最新のバージョンではなく、バージョンを指定してバージョンアップしたいことがあります。

その場合、次のように@の後にバージョンレンジかタグを指定します。

7.2.15に指定する例
ng update @angular/cli@7.2.15 @angular/core@7.2.15

このバージョンを指定してバージョンアップする方法は、よく参照される次のドキュメントには記載がありません。

上記のドキュメントには記載がありませんが、angular/angular-cli中のspecifications/update.mdに記載があります。

You can specify more than one package. Each package follows the convention of [@scope/]packageName[@version-range-or-dist-tag].


ちなみに、ng updateにはfromtoというオプションがありますが、これはmigrateOnlyと一緒にしか使えません。

--migrateOnly=true|false

Only perform a migration, does not update the installed version.


個人的にはここに明記してほしい・・・

Angularにissue報告したけれど、採用されなそう・・・

8
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
3