brew install mongodbでエラーになったとき

2019年11月3日 Off By ryosuke-hujisawa
$ brew install mongodb
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
itk                                                                                                   yq
==> Deleted Formulae
gmtl

Error: No available formula with the name "mongodb" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
fujisawukenoMBP:html_menu_1 ryosuke-hujisawa$ brew update
Already up-to-date.
fujisawukenoMBP:html_menu_1 ryosuke-hujisawa$ brew install mongodb
Updating Homebrew...
Error: No available formula with the name "mongodb" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
fujisawukenoMBP:html_menu_1 ryosuke-hujisawa$ brew install mongodb-community@4.2
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
git-delta                                                                                             gtk-gnutella

Error: No available formula with the name "mongodb-community@4.2" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

とかなった

$ brew tap mongodb/brew
$ brew install mongodb-community@4.2

で治った