もふふのはてな

メインのブログに書くほどではない雑多な記事を置く場所

yarnに「There appears to be trouble with your network connection.」と言われたら

この記事はQiitaから移転されました。

yarn installで下記のようなメッセージが出てインストールが終わらなくなりました。

[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

ネットワークが正常なのにこのような現象が起きているならば、大きなパッケージをダウンロードしようとしてタイムアウトしている可能性が考えられます。その場合、次のようにタイムアウトの時間を明示的に大きくすることで解決できます。

$ yarn install --network-timeout 1000000

あるいは設定を変更します。

$ yarn config set network-timeout 1000000

参考