"command not found: mongod" 尽管更新 PATH 还是出错

"command not found: mongod" error despite updating PATH

我添加了这一行

export PATH=$PATH:"/Users/pouya/mongodb/bin:$PATH"

我的 .bash_profile,但我仍然收到此错误:

zsh: command not found: mongod

我使用 macOS Catalina,MongoDB。

由于我所在国家/地区的限制,我无法使用 Brew,我想手动安装 MongoDB,我该怎么做?

对于 macOS Catalina,zsh 是默认的 shell,因此您应该在这一行到 ~/.zshrc 文件

vim ~/.zshrc

export PATH=$PATH:"/Users/pouya/mongodb/bin:$PATH"


source ~/.zshrc