モノクロタイム

I'm from the future!

material-uiのiconパッケージを入れるとtimeoutするのをなんとかする

デジコンの会場でも悩んで今も悩んだのでメモ。

[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...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.11.2.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "D:\\hoge\\fuga\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/upgrade for documentation about this command.

これのこれ

error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.11.2.tgz: ESOCKETTIMEDOUT".

いつからかは知らないけれど、material-uiのicon周りを持ってくるときに重いのかタイムアウトするようになってしまった。

material-ui.com

コワーキングスペースのネットはともかくとして、家の回線でもタイムアウトするのでこれはおかしいぞってことで色々調べてみる。

解決策としてはyarn upgrade(add)の--network-timeoutオプションを付与すればOKぽい。時間はお好みで。

yarn upgrade --network-timeout 600000

結構頻繁にupgrade(add)する人は.yarnrc

network-timeout 600000

と書いておけば通常のタイムアウト判定時間より長く待ってくれるっぽい。 ちなみにこれでmaterial-uiのiconパッケージは無事入りました(upgradeできました)

ではでは。

reiji1020.hatenablog.com