简体   繁体   English

MongoDB,zsh:找不到命令:mongo

[英]MongoDB , zsh: command not found: mongo

I just installed MongoDB through homebrew and ran it as a macOS service, then I started the server with command:我刚刚通过自制软件安装了 MongoDB 并将其作为 macOS 服务运行,然后我使用以下命令启动了服务器:

brew services start mongodb-community@4.4酿造服务启动 mongodb-community@4.4

==> Successfully started mongodb-community@4.4 (label: homebrew.mxcl.mongodb-community@4.4) ==> 成功启动mongodb-community@4.4 (标签:homebrew.mxcl.mongodb-community@4.4)

so it's running所以它正在运行

but when I tried to run the mongo shell with command: mongo it just showed zsh: command not found: mongo但是当我尝试使用命令运行 mongo shell 时:mongo 它只是显示 zsh: command not found: mongo

add the mongo location path to the zsh PATH variable:将 mongo 位置路径添加到 zsh PATH 变量中:

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

open new terminal and try starting again打开新终端并尝试重新开始

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

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