简体   繁体   中英

zsh: command not found: mongod, unable to use mongodb

I have installed mongodb and was trying to run with macbook zsh:

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

But I get this error:

zsh: command not found: mongod

I have tried these stack overflow answers and it didnt work.

  1. I followed the same tutorial, why do I receive this message, but others don't?
  2. What is the reason for this error?
  3. How can I fix it?

If you have installed mongo correctly then it is likely not reachable via your PATH variable. I would recommend following the official mongodb instructions for installing mongo using homebrew.

https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/

Once that is done you should be able to restart your terminal and be able to run the command provided.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM