cmdxray / commands / pnpm

What does pnpm do?

a fast, disk-efficient Node.js package manager.

▸ Explain your own pnpm command →

pnpm examples, explained

$ pnpm add -D vitest

  • pnpma fast, disk-efficient Node.js package manager
  • addadd a dependency to the project
  • -Dadd to devDependencies
  • vitestan argument passed to the command

$ pnpm install --frozen-lockfile

  • pnpma fast, disk-efficient Node.js package manager
  • installinstall project dependencies
  • --frozen-lockfilefail rather than update the lockfile

$ pnpm -r run build

  • pnpma fast, disk-efficient Node.js package manager
  • -rrun the command in every workspace package (recursive)
  • runrun a script defined in package.json
  • buildan argument passed to the command

pnpm subcommands

install — install project dependenciesadd — add a dependency to the projectremove — remove a dependencyrun — run a script defined in package.jsondlx — download and run a package one-offexec — run a command from a local dependency's binariesupdate — update dependencies to newer allowed versionswhy — show which packages depend on a given one

pnpm flags & options

-Dadd to devDependencies
--save-devadd to devDependencies
--frozen-lockfilefail rather than update the lockfile
--prodinstall only production dependencies
-rrun the command in every workspace package (recursive)
--recursiverun the command in every workspace package
--filterrestrict the command to matching workspace packages
-goperate on globally-installed packages
--globaloperate on globally-installed packages

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.