0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Angular v9.x から v10.x にした時の問題点

Last updated at Posted at 2022-08-03

Angular v9の環境からv10に上げる過程で困ったこと・対処メモ

困った内容

Angularを9から10にしようとした時に、@angular/cdk@angular/materialが10に上がらない問題が発生。
下記の状態になってしまった…

 Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cdk                       9.2.4 -> 10.2.7         ng update @angular/cdk@10
      @angular/cli                       10.2.4 -> 11.2.9         ng update @angular/cli@11
      @angular/core                      10.2.5 -> 11.2.9         ng update @angular/core@11
      @angular/material                  9.2.4 -> 10.2.7         ng update @angular/material@10

この状態のでng serveしてみると下のエラーが表示されるようになった。

deprecationwarning access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created) 

この時のDockerFileの設定。

FROM node:16.15.1-stretch

ENV PYTHONUNBUFFERED 1

RUN npm install -g @angular/cli@^10

EXPOSE 8080

原因は?

原因としてはNode.jsのバージョンが新しすぎたっぽい。
Node.jsのバージョンを14.17.5に変更。

FROM node:14.17.5-stretch

ENV PYTHONUNBUFFERED 1

RUN npm install -g @angular/cli@^10

EXPOSE 8080

変更後、@angular/cdkと@angular/materialをアップデート。
無事にアップデートが完了した。

# ng update
Using package manager: 'npm'
Collecting installed dependencies...
Found 36 dependencies.
    We analyzed your package.json, there are some packages to update:
    
      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cdk                       10.2.7 -> 11.2.9         ng update @angular/cdk@11
      @angular/cli                       10.2.4 -> 11.2.9         ng update @angular/cli@11
      @angular/core                      10.2.5 -> 11.2.9         ng update @angular/core@11
      @angular/material                  10.2.7 -> 11.2.9         ng update @angular/material@11

このあとは…

バージョンアップを引き続き行っていく予定
10->11
11->12
12->13
13->14
となる予定?予定は未定。

こうした方がいいよ、ここ間違ってるよ等あったらご指摘お願い致します。

参考記事

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?