1. Remove the Corepack Shims (Uninstalls Corepack-managed pnpm)
Corepack works by creating shim binaries for package managers.Running the disable command removes these shims (including pnpm and yarn):
corepack disable
2. Delete Corepack’s Cache & Downloaded Binaries
Corepack stores downloaded package manager binaries in a global cache directory. Delete this folder to completely clean up downloaded pnpm versions:
- macOS / Linux:
rm -rf ~/.cache/node/corepack # Or if using XDG defaults: rm -rf ~/.local/share/corepack - Windows (Command Prompt):
rmdir /s /q "%LOCALAPPDATA%\node\corepack" - Windows (PowerShell):
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\node\corepack"
3. Uninstall Corepack Itself
Depending on how Corepack was installed on your machine:
- If installed manually via npm:
npm uninstall -g corepack - If installed via Homebrew (macOS):
brew uninstall corepack - If included with Node.js (.msi installer on Windows or pre-packaged binary):
Corepack comes bundled with Node.js by default. Runningcorepack disable(Step 1) is sufficient to remove its executable shims from yourPATH. If you want to strip it entirely from a Windows Node.js installation, run the Node.js.msiinstaller, choose Modify, and uncheck the Corepack manager feature.
4. Verify Cleanup
Check that neither command is available in your shell:
corepack --version
pnpm --version
Both commands should return command not found (or equivalent).