Installing MongoDB with Homebrew on MAC

Share

When i execute brew install mongodb the error message above appears :

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.

How i solve this problem:

The formula mongodb has been removed from homebrew-core.  So i need to use a custom tap made by mongodb team

I used the following commands

brew update
brew tap mongodb/brew
brew install mongodb-community
sudo mkdir /data/db
chmod -Rv <myusername> /data/db

Now i can run mongod to start the server or if you want you can use brew services start mongodb-community