Skip to content

Instantly share code, notes, and snippets.

@suhailroushan13
Created November 28, 2025 13:34
Show Gist options
  • Select an option

  • Save suhailroushan13/8609dd29872918f57a975daf5811e202 to your computer and use it in GitHub Desktop.

Select an option

Save suhailroushan13/8609dd29872918f57a975daf5811e202 to your computer and use it in GitHub Desktop.
All Packages

PNPM Commands Cheat Sheet πŸš€

πŸ“Œ Initialization Commands

  • pnpm init - Create new package.json with default values

πŸ“¦ Install Dependencies

  • pnpm add <package> - Install a package locally
  • pnpm install - Install all deps from package.json
  • pnpm add react@18 - Install specific version

πŸ”„ Remove / Update Packages

  • pnpm remove <package> - Remove a dependency
  • pnpm update - Update all dependencies
  • pnpm update <package> - Update a specific dependency

βš™οΈ Run Scripts

  • pnpm run <script> - Run a script

🧩 Node Modules / Store Management

  • pnpm store path - Show global store path
  • pnpm store status - Show store health
  • pnpm prune - Remove unused packages

πŸ” Inspect / Check

  • pnpm list - Show installed dependencies
  • pnpm list --depth 0 - Show top-level packages only
  • pnpm why <package> - Check why package is installed
  • pnpm outdated - Show outdated dependencies

πŸ’Ύ Reinstall / Fix

  • pnpm install --force - Reinstall everything freshly

πŸ”₯ Quick Comparison

Task npm pnpm
Install dependency npm install pkg pnpm add pkg
Install dev dependency npm install -D pkg pnpm add -D pkg
Install globally npm install -g pkg pnpm add -g pkg
Remove dependency npm uninstall pkg pnpm remove pkg
Run script npm run dev pnpm dev

πŸ“Œ Tip:

Use pnpm add instead of pnpm install <pkg>
It is the recommended and clean syntax.


End of Cheat Sheet 🎯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment