How to install pnpm in windows

Share:

You can install pnpm (Performant NPM) on Windows using multiple methods. Below are the most common ways:


Method 1: Install via PowerShell (Recommended)

  1. Open PowerShell as Administrator.
  2. Run the following command: powershellCopyEditiwr https://get.pnpm.io/install.ps1 -useb | iex
  3. Restart your terminal and verify the installation: powershellCopyEditpnpm -v

Method 2: Install via npm

If you already have Node.js and npm installed, you can install pnpm using npm:

  1. Open Command Prompt (cmd) or PowerShell.
  2. Run: shCopyEditnpm install -g pnpm
  3. Verify installation: shCopyEditpnpm -v

Method 3: Install via Corepack

Corepack is included with recent Node.js versions (>=16.10):

  1. Enable Corepack: shCopyEditcorepack enable
  2. Install pnpm: shCopyEditcorepack prepare pnpm@latest --activate
  3. Check installation: shCopyEditpnpm -v

Method 4: Install via Scoop (Windows Package Manager)

If you use Scoop, you can install pnpm easily:

  1. Open PowerShell and install Scoop if not installed: powershellCopyEditiwr -useb get.scoop.sh | iex
  2. Install pnpm using Scoop: powershellCopyEditscoop install pnpm
  3. Verify installation: powershellCopyEditpnpm -v

Method 5: Install via Chocolatey

If you use Chocolatey, you can install pnpm with:

  1. Open Command Prompt as Administrator.
  2. Run: shCopyEditchoco install pnpm -y
  3. Verify installation: shCopyEditpnpm -v

After Installation: Configure PNPM

If you installed pnpm via a script, you may need to add it to your PATH manually:

  • Open PowerShell and run: powershellCopyEdit$env:Path += ";$HOME\AppData\Local\pnpm"

Conclusion

The recommended way is using PowerShell:

powershellCopyEditiwr https://get.pnpm.io/install.ps1 -useb | iex

If you already have Node.js, using:

shCopyEditnpm install -g pnpm

is a simple alternative.

LET’S KEEP IN TOUCH!

We’d love to keep you updated with our latest news and offers 😎

We don’t spam! Read our privacy policy for more info.