- Published on
How to Downgrade pnpm Easily
- Authors
- Name
- Ripal & Zalak
How to Downgrade pnpm Easily
Want to downgrade pnpm to an older version? Follow this simple guide to switch pnpm versions step-by-step.
Why Downgrade pnpm?
You may need an older version of pnpm for:
- Compatibility with specific projects.
- Older Node.js versions.
- Issues with the latest pnpm release.
Methods to Downgrade pnpm
1. Downgrade Using pnpm
- Run this command to install an older version:Example for version 6.32:
pnpm add -g pnpm@<version>
pnpm add -g [email protected]
- Check the installed version:
pnpm --version
2. Downgrade with Corepack
- Enable Corepack (comes with Node.js 16.13+):
corepack enable
- Use Corepack to install a specific pnpm version:Example:
corepack prepare pnpm@<version> --activate
corepack prepare [email protected] --activate
- Confirm the version:
pnpm --version
3. Manual Uninstall and Reinstall
- Find pnpm Install Location:
echo $PNPM_HOME
- Remove pnpm: On Linux/Mac:On Windows, delete the folder manually.
sudo rm -rf $PNPM_HOME
- Reinstall Specific Version:
npm install -g pnpm@<version>
4. Use Node Version Manager (nvm)
- Switch to another Node.js version:
nvm install <node-version> nvm use <node-version>
- Install pnpm for that Node.js version:
npm install -g pnpm@<version>
Find pnpm Versions
Check available pnpm versions on the GitHub Releases page.
Quick FAQ
Can I downgrade pnpm without uninstalling?
Yes, use pnpm add -g
or corepack prepare
to directly switch versions.
How do I update pnpm again?
Run:
pnpm add -g pnpm@latest
Or:
corepack prepare pnpm@latest --activate
Does downgrading affect projects?
Only if the project needs features from a newer version. Check compatibility before downgrading.
Conclusion
Downgrading pnpm is easy with tools like Corepack, nvm, or manual commands. Choose the method that suits your system and projects best.