January 16, 2024

command not found:

Why?

Environment variables were not set properly to add to the system PATH.



Environment



Steps

  1. Open Terminal and edit the Zsh configuration file .zshrc using vi or other IDE you liked

    1
    vi ~/.zshrc
  2. Add the following contents inside and save

    command not found:mysql

    1
    export PATH=${PATH}:/usr/local/mysql/bin/

    command not found:nvm

    1
    2
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  3. Reload the Zsh configuration .zshrc to take effect

    1
    source ~/.zshrc
  4. Validate

    1
    2
    3
    4
    # MySQL
    mysql --version
    # NVM
    nvm --version


References

About this Post

This post is written by Andy, licensed under CC BY-NC 4.0.

#macOS#TroubleShooting