Solution: zsh: command not found: mongod

If MongoDB is not installed properly in the system, then this error comes on command prompt. To fix this problem follow the below steps.

Try to install MongoDB by using Homebrew. Before that ensure Homebrew is installed or not by using the following command.

If Homebrew is not installed, install it. After completion of Homebrew installation, Add MongoDB to Homebrew’s list of packages by using the following command.

Install the latest version of MongoDB with the following command.

Now check with the command mongod in the command prompt. Now it won’t show the error message as command not found.