I just installed oh-my-zsh on iTerm2 and have been working on a project with MongoDB/node.
Now when I try to start the db with command 'mongo' I get a return 'zsh: command not found: mongo'
the command works perfectly fine in the built-in terminal for VSCode.
would like to be able to use iTerm exclusively instead of the vscode terminal.
Go to VSCode terminal and execute:
echo "$PATH"
Check where the mongo binary is located:
which mongo brew info mongo
Go to your zsh and add to your.zshrc file the path where mongo is located:
export PATH="$PATH:/opt/homebrew/bin"
If you do not add the path you will still be able to run it like:
/opt/homebrew/bin/mongo
I'm not sure why, but when I went directly into the.zshrc file and added this line
export PATH="$PATH:/opt/homebrew/bin"
the command 'mongo' still didn't start the db.
BUT..
I figured it out. Instead of opening my.zshrc and editing it I just edited my path with this little line here with the path described by R2D2
path+=/opt/homebrew/bin/
Command 'mongo' is working perfectly now!
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.