pnpm has three install paths and any of them works. Pick whichever fits your existing toolchain.
Homebrew (recommended on macOS): brew install pnpm — keeps pnpm versioned alongside everything else in your Brewfile. Upgrades with the rest of your weekly brew upgrade ritual.
npm: npm install -g pnpm — simplest, but requires npm and the global-install permissions to be sane. Useful if you don't use Homebrew.
Corepack: corepack enable && corepack prepare pnpm@latest --activate. Corepack ships with Node.js 16.9+ and is Node's official package-manager-version-manager. The advantage is that you can pin pnpm's version in package.json ("packageManager": "pnpm@10.0.0") and corepack will use that exact version. The downside is that Corepack itself has had some rough edges historically.
After install, verify with pnpm --version. Upgrade in place with pnpm self-update.