Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

4.3K
Vistas
Zsh: Command Not found : mongo After trying to install mongodb 4.2 using brew

I have tried the following steps to install and setup mongodb in my mac from here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ but I got the following error when running the final "mongo" command in my terminal:

Error Message - Zsh: Command Not found : mongo

This error msg occurred after trying to install mongodb 4.2 using brew

sudo chown -R $(whoami) $(brew --prefix)/*

then

brew tap mongodb/brew

then

brew install mongodb-community@4.2

and

brew services start mongodb-community@4.2

or

mongod --config /usr/local/etc/mongod.conf

then

ps aux | grep -v grep | grep mongod

and

mongo

running brew services start mongodb-community@4.2 returns:

Successfully started `mongodb-community@4.2` (label: homebrew.mxcl.mongodb-community@4.2)

running ps aux | grep -v grep | grep mongod returns:

9081   0.2  0.5  5528024  41856   ??  S     3:01pm   0:01.48 /usr/local/opt/mongodb-community@4.2/bin/mongod --config /usr/local/etc/mongod.conf

7613   0.0  0.1  4298832   5600 s000  T     2:47pm   0:00.08 vim /usr/local/etc/mongod.conf

running mongod --config /usr/local/etc/mongod.conf returns:

zsh: command not found: mongod

There are also no mongo files in my /usr/local/bin directory after using these commands

I created a data/db folder in my /usr/local/bin directory using the following commands:

sudo mkdir -p  /usr/local/bin/data/db   
sudo chown -R `id -un`  /usr/local/bin/data/db      

Running "brew update" returns:

brew update                                                                                                                                                    
Updated 1 tap (homebrew/cask).
==> Updated Casks
brave-browser
over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Solved it by manually installing the mongodb community files and db tools using the website instead. Then copying them into /usr/local/bin. Then ignoring the app permissions whenever calling mongo or related commands in the terminal through System Preferences > Security & Privacy > General.

After googling I found out that mongoimport and the other features have to be installed separately: https://www.mongodb.com/try/download/database-tools

Followed by copying those bin files after extracting them into the same /usr/local/bin directory

Not sure why its' not working through homebrew though

over 4 years ago · Santiago Trujillo Denunciar

0

This worked for me, I was having same issue on mongodb-community@4.4

 brew reinstall mongodb-community@4.4  

On terminal something like this will appear during reinstallation.

enter image description here

copy highlighted path with echo

 echo 'export PATH="/opt/homebrew/opt/mongodb-community@4.4/bin:$PATH"' >> ~/.zshrc

Now open another terminal and start mongodb services

brew services restart mongodb/brew/mongodb-community@4.4

write mongo on terminal and here we fly

enter image description here

over 4 years ago · Santiago Trujillo Denunciar

0

If you installed the mongodb via Homebrew. Need to add the mongo path in your bash_profile.

  • Edit the bash_profile vi ~/.bash_profile
  • Add the below line in EOF export PATH=$PATH:/usr/local/opt/mongodb-community@4.2/bin
  • After the edit bash_profile. Close all terminals and open them again. mongo command start works.
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda