Published on

How to Downgrade pnpm Easily

Authors
  • Name
    Ripal & Zalak
    Twitter

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

  1. Run this command to install an older version:
    pnpm add -g pnpm@<version>
    
    Example for version 6.32:
    pnpm add -g [email protected]
    
  2. Check the installed version:
    pnpm --version
    

2. Downgrade with Corepack

  1. Enable Corepack (comes with Node.js 16.13+):
    corepack enable
    
  2. Use Corepack to install a specific pnpm version:
    corepack prepare pnpm@<version> --activate
    
    Example:
    corepack prepare [email protected] --activate
    
  3. Confirm the version:
    pnpm --version
    

3. Manual Uninstall and Reinstall

  1. Find pnpm Install Location:
    echo $PNPM_HOME
    
  2. Remove pnpm: On Linux/Mac:
    sudo rm -rf $PNPM_HOME
    
    On Windows, delete the folder manually.
  3. Reinstall Specific Version:
    npm install -g pnpm@<version>
    

4. Use Node Version Manager (nvm)

  1. Switch to another Node.js version:
    nvm install <node-version>
    nvm use <node-version>
    
  2. 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.