Running into problems installing MongoDB on MacOS Terminal Running into problems installing MongoDB on MacOS Terminal mongoose mongoose

Running into problems installing MongoDB on MacOS Terminal


I am experiencing the exact same problem (I am using MacOC version 11.5.1).

The reason why your brew tap mongodb does not seem to be doing anything may be because you have already tapped into mongodb. Try untapping with brew untap mongodband retapping with brew tap mongodb/brew.

After you have established the connection, try installing again with brew install mongodb-community@5.0. At this stage, I could not get the installation to work for version 5.0 so I installed version 4.4 instead (with brew install mongodb-community@4.4).

After that, try running mongo with brew services start mongodb-community@5.0 (or brew services start mongodb-community@4.4 if you have installed 4.4 version) and it should work just fine!

If you have installed version 4.4, be sure to run the command PATH="/usr/local/opt/mongodb-community@4.4/bin" mongo to start the mongo shell.


I had the same happen, however my issue was actually with this error:

fatal: could not solve HEAD to a revision

solve it using:

git -C $(brew --repository homebrew/core) checkout master

you can also:

brew updatebrew upgradebrew upgrade --caskbrew cleanup

and then restart the mongodb community edition install process again! Worked for me!


  1. Check with brew list | grep mongo that mongodb-community, mongodb-database-tools, mongosh exist at your PC. If they do not exist, install them with brew.

  2. Recently also installed mongodb V4.4.5 and can not start it with brew services start mongodb-community. For me works starting it manually as a background process as admin sudo mongod --config /usr/local/etc/mongod.conf --fork

  3. And last call mongo to work with mongoDB shell.

Reason: directory/file access issue. Not sure.