6

Trying to install mongodb server on my mac using Brew but getting this error. enter image description here

Updated my brew to latest version, still egtting this error. Command i used: brew install mongodb-community@6.0

Zohaib Amir
  • 221
  • 2
  • 8

1 Answers1

8

I figured it out myself. Here is the solution which I found out. I am using mac os on intel processor.

I first run

rm -fr $(brew --repo homebrew/core)

then

brew tap homebrew/core

then

brew tap mongodb/brew

then installed it

brew install mongodb-community@6.0

This worked for me.

Zohaib Amir
  • 221
  • 2
  • 8
  • 2
    Thank you for this answer. I've been trying to install mongodb for over a month now, but all the tutorials I found were for earlier versions and required me to create a `/data/db` directory which is no longer allowed in current versions of macOS. I only had to run `brew tap mongodb/brew` and the `install` command though, without needing to delete the `homebrew/core` directory. – Praise Dare Jan 05 '23 at 08:58
  • 1
    For the latest version please check the MongoDB website and change the mongodb-community@6.0 to whatever latest version and replace 6.0 with the latest version number for e.g 6.2 or 6.2 ... – Zohaib Amir Feb 05 '23 at 17:04