“zsh: No match found” error

zsh attempts to expand any potential filename wildcard characters (such as ‘*’ and ‘?’) used in a command before executing it. This can lead to the confusing error “zsh: No match found” error. What makes this confusing is if you’re trying to execute a grep or something where you are trying to find or match something, since the error implies your search is not working, whereas the error is about the patterns zsh is attempting to expand in the command string, and not from executing the command itself.

Depending on what you’re trying to do, the easiest workaround is to wrap parameters in quotes or escape characters like ‘*’ and ‘?’.

e.g. for curl, wrap urls in quotes.

MacOS Catalina, npm global installs and zsh

As MacOS switched to zsh replacing bash a while back (you may have noticed the prompt to change to zsh in your Terminal), I keep coming across a few issues that I need to work around. My latest was that I noticed apps I’d installed globally with ‘npm install -g’ were no longer in my path.

Following a combination of suggestions from answers to this question, I added the following line to ~/.zshrc to add the npm global install dir to my path:

export PATH="$PATH:$HOME/.npm-global/bin"