简体   繁体   English

zsh:找不到命令:mongod,无法使用mongodb

[英]zsh: command not found: mongod, unable to use mongodb

I have installed mongodb and was trying to run with macbook zsh:我已经安装了 mongodb 并尝试使用 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.如果您已正确安装 mongo,则可能无法通过 PATH 变量访问它。 I would recommend following the official mongodb instructions for installing mongo using homebrew.我建议按照官方 mongodb 说明使用自制软件安装 mongo。

https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/ 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.完成后,您应该能够重新启动终端并能够运行提供的命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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