This page is a quick reference for day-to-day pnpm usage.
Install the dependencies a project already declares
pnpm install
Run this after cloning a repository or after pulling dependency changes from someone else.
Add a new dependency
pnpm add react
This adds the package to the project and updates pnpm-lock.yaml.
To add several dependencies at once:
pnpm add react react-dom
Add development dependencies
pnpm add -D typescript
To add several development dependencies in one command:
pnpm add -D typescript eslint prettier
Remove a package
pnpm remove react
Add a peer dependency
pnpm add --save-peer react
Run project scripts
pnpm dev
pnpm build
pnpm test
These run scripts defined in package.json.
Run a local tool directly
pnpm exec eslint .
Run a tool one time without adding it permanently
pnpm dlx create-vite@latest my-app
This is the pnpm parallel to npx.
Reproduce installs in CI
pnpm install --frozen-lockfile
Use this when you want CI to fail instead of silently drifting away from the committed lockfile.