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 3 years have passed since last update.

Error: You are using an unsupported version of Node. Please update to at least Node vの対処法

Posted at
npm run watch

をして、JavaScriptをコンパイルして、JavaScriptの変更を反映しようとしたら、

Error: You are using an unsupported version of Node. Please update to at least Node v12.14

というエラーが出てきました。

その時に、調べていくと、どうもnpmのバージョンが古いみたいみたいだなと思ったので、

npm run update

をしてみてもうまく行かないなと思いました。
ただ、エラーメッセージをよく見ていくと、

Please update to at least Node v12.14

ってことは、Nodeのバージョンを上げればいいのかなと思ったので、Dockerfileをチェックしてみました。そしたら、


COPY --from=node:10.22 /usr/local/bin /usr/local/bin
COPY --from=node:10.22 /usr/local/lib /usr/local/lib

となっていました。ここが古いのが原因なのかなと思ったので、ここの

node:10.22

となっているところのバージョンを、エラーメッセージにでている番号を変更しました。

COPY --from=node:12.14 /usr/local/bin /usr/local/bin
COPY --from=node:12.14 /usr/local/lib /usr/local/lib

二つとも、12.14にバージョンを変更しました。
変更した後に忘れずに

docker-compose build

をしたら、無事解決しました。

Nodeのバージョンが古いとバージョンアップをしないといけないのですね。
今回のことで学ぶことが出来ました。
よかったよかった。

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?