brew updateがエラーで実行されない

以前にnodenvでバージョンが見つからなかった場合の対応方法の記事でbrew updateを使う方法を紹介しましたが、現在だとbrew updateをするとエラーになるようだったので、代わりの方法を試してみます。

エラー内容

brew updateを実行すると以下のようなエラーが表示されました。

Error: 
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

翻訳して確認すると、「`brew update`を実行するには以下のコマンドを実行してください」とあります。

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

環境によってコマンド内のパスが異なることがあるので、実際に表示されたエラー内のコマンドを実行ください。
実行後少し待つとアップデートが行えました。

補足

以降は以前投稿したnodenvで必要なバージョンが見つからなかった場合の対応方法の補足ですが、この後にbrew upgrade node-build を実行しても必要なバージョンが確認できませんでした。
node-buildだけでなくnodenvのアップデートも必要なようでした。

brew upgrade nodenv node-build

これで必要なバージョンを確認することができました。

参考サイト

このエントリーをはてなブックマークに追加

関連記事

コメントを残す

メールアドレスが公開されることはありません。
* が付いている欄は必須項目です

CAPTCHA


コメントが承認されるまで時間がかかります。

2024年5月
 1234
567891011
12131415161718
19202122232425
262728293031