hub update was detecting the package manager by checking which ones were installed on the system (pnpm --version, yarn --version), not which one actually installed the hub CLI. If you had pnpm installed but used npm to install hub globally, it would try to update via pnpm and fail.
The fix
Detection now follows this priority:
npm_config_user_agent— set automatically when running via a PM (e.g.pnpm exec hub update)which hubpath inspection — checks if the binary lives under a/pnpm/or/yarn/directorypnpm list -g/yarn global list— checks which PM actually has the package registered- Falls back to
npm
The install command was also extracted into buildInstallCommand() so pnpm correctly uses pnpm add -g instead of pnpm install -g.
Upgrade
hub update