Published on

TIL: `brew install` warns when another copy of the tool sits earlier on your PATH

Authors

I updated a CLI through Homebrew and the version did not change.

Homebrew had told me why in its output:

The following tailscale executables are shadowed by other commands earlier in your PATH:
 tailscale (shadowed by /usr/local/bin/tailscale)
Running these by name will not invoke the version provided by Homebrew.

which -a lists every match in PATH order, not just the first:

which -a tailscale
# /Users/me/.local/bin/tailscale
# /opt/homebrew/bin/tailscale
# /usr/local/bin/tailscale

I have three copies. Typing the name runs the first one, which is not the one Homebrew just updated.

To check which one you are really running, use type -a name or run the full path with --version. Then delete the stale copies, or move the folder you want to the front of PATH.

Read the caveats block at the end of an install. It said this plainly, and I had scrolled past it.