Skip to main content
Version: 4.x

pnpm recursive


pnpm install -rruns installation for every package in every subfolder
pnpm run build --filter foo-*builds all packages with names that start with foo-
pnpm update -- login-page...updates dependencies in login-page and any dependencies of login-page that are also in the repository


--filter <package_selector>#

Read more about filtering.


Added in: v2.13.0

  • Default: 4
  • Type: Number

Set the maximum number of concurrency. For unlimited concurrency use Infinity.


Added in: v2.13.0

  • Default: true
  • Type: Boolean

If true, stops when a task throws an error.

This config does not affect the exit code. Even if --no-bail is used, all tasks will finish but if any of the tasks fail, the command will exit with a non-zero code.

Usage example. Run tests in every package. Continue if tests fail in one of the packages:

pnpm recursive test --no-bail


Added in: v2.14.0

  • Default: true
  • Type: Boolean

When true, packages are sorted topologically (dependencies before dependents). Pass --no-sort to disable.

Usage examples:

pnpm recursive test --no-sort

pnpm recursive exec#

Added in: v2.9.0

pnpm recursive exec -- <command> [args...]

This command runs a command in each package of the monorepo.

The name of the current package is available through the environment variable PNPM_PACKAGE_NAME (supported from pnpm v2.22.0).

Usage examples:

pnpm recursive exec -- rm -rf node_modulespnpm recursive exec -- pnpm view $PNPM_PACKAGE_NAME