This error is caused by the terminal no longer identify your environment variables which you set up in "~/.bash_profile" in the previous Mac OS version.
The ZSH terminal is now using "~/.zprofile" for the environment variables so to solve this issue, all you need to do is copy everything inside your "~/.bash_profile" to your "~/.zprofile" and everything should work normally.