furoblog’s blog

妻と一緒にはじめました。1日1更新が目標です。

Angular9アプデメモ

Angular9

Angular9



Angularアップデート

公式サイトは以下、今回は、8.2系から9.0へのアップデート。

update.angular.io

 

手順

npmを最新化する

npm -v npm update npm

8系の最新版に上げる

ng update @angular/core@8 @angular/cli@8

1度ここで動作確認

ng version

ng serve --open

ng test

ng test --no-watch --code-coverage

ng e2e

ng lint

 

アプデ候補チェック後、アプデが必要なモジュールを上げる

ng update

ng update @angular/cli

ng update

typescript3.7系が入っているかチェック(入ってたのでSkip)

npm ls -g typescript

他のライブラリの最新化

以下のコマンドで更新すべきライブラリ一覧を取得する。

npm outdated

ng update @types/jasmine

ng update @types/node

ng update jasmine-core

ng update karma karma-chrome-launcher karma-coverage-istanbul-reporter karma-jasmine

ng update ts-node

ng update karma-jasmine-html-reporter

ng update popper.js

ng update protractor

npm outdated

最適化失敗

ng update @ng-bootstrap/ng-bootstrap

ng update tslint

※ここについては、依存関係にある別のモジュールがまだAngular9にモジュールが対応していない模様。 日程を改めて更新してみよう。

Angular9で新しく必要になったモジュールを追加

ng add @angular/localize

最終確認確認

ng version

ng serve --open

ng test

ng test --no-watch --code-coverage

ng e2e

ng lint

 

感想

公式がアプデ手順をちゃんと出してくれているのはありがたい。

さすがはGoogle.

とは言え、色々と変わっている部分があるので不具合を発見したら都度チェックしていく。