You can install pnpm
(Performant NPM) on Windows using multiple methods. Below are the most common ways:
Method 1: Install via PowerShell (Recommended)
- Open PowerShell as Administrator.
- Run the following command: powershellCopyEdit
iwr https://get.pnpm.io/install.ps1 -useb | iex
- Restart your terminal and verify the installation: powershellCopyEdit
pnpm -v
Method 2: Install via npm
If you already have Node.js and npm
installed, you can install pnpm
using npm
:
- Open Command Prompt (cmd) or PowerShell.
- Run: shCopyEdit
npm install -g pnpm
- Verify installation: shCopyEdit
pnpm -v
Method 3: Install via Corepack
Corepack is included with recent Node.js versions (>=16.10):
- Enable Corepack: shCopyEdit
corepack enable
- Install
pnpm
: shCopyEditcorepack prepare pnpm@latest --activate
- Check installation: shCopyEdit
pnpm -v
Method 4: Install via Scoop (Windows Package Manager)
If you use Scoop, you can install pnpm
easily:
- Open PowerShell and install Scoop if not installed: powershellCopyEdit
iwr -useb get.scoop.sh | iex
- Install
pnpm
using Scoop: powershellCopyEditscoop install pnpm
- Verify installation: powershellCopyEdit
pnpm -v
Method 5: Install via Chocolatey
If you use Chocolatey, you can install pnpm
with:
- Open Command Prompt as Administrator.
- Run: shCopyEdit
choco install pnpm -y
- Verify installation: shCopyEdit
pnpm -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.