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.

the engine "node" is incompatible with this module.が出た時の対処法

Posted at

yarn installした時に
「The engine "node" is incompatible with this module. Expected version "^15.0 || ^16.0 || ^17.0 || >=18.0.0". Got "19.9.0"」

のようなエラーが出ることがあります。

原因

インストールされているnodeのバージョンが非互換であることが原因です。

対策

nodeのバージョンを下げる必要があります。


下記コマンドを叩き、変更可能なnodeのバージョンを調べます。
nodebrew ls-remote
すると以下にバージョンが出現します。

v17.6.0   v17.7.0   v17.7.1   v17.7.2   v17.8.0   v17.9.0   v17.9.1   
v18.0.0   v18.1.0   v18.2.0   v18.3.0   v18.4.0   v18.5.0   v18.6.0   v18.7.0
v18.8.0   v18.9.0   v18.9.1   v18.10.0  v18.11.0  v18.12.0  v18.12.1  v18.13.0
v18.14.0  v18.14.1  v18.14.2  v18.15.0  v18.16.0 


以下のコマンドで指定のバージョンに変更
今回は18.0.0を指定

nodebrew install-binary v8.16.0

この方法で切り替わるはずです。

もし切り替わらない、エラーが出現する場合は以下のサイトを参考にしてください。
https://qiita.com/k3ntar0/items/322e668468716641aa5c

まとめ

今回は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?