Recently when I open my iTerm2, I got the message
complete:13: command not found: compdef, where it is coming from?
After some research, the answer is in my
these two lines are added when I recently re-install nodejs using nvm, you can find this info from nvm readme - Git install section
But it is in zsh, so no need to load nvm bash_completion, comment out the line
[-s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion will solve the problem.
Now re-open a new session, error message is gone.