Skip to content
Latchkey

pnpm/action-setup

Install the pnpm package manager, so setup-node can cache the pnpm store.

Community actionCategory: Language & Toolchain SetupLatest v4View on GitHub

What it does

pnpm/action-setup installs pnpm and puts it on PATH. Because setup-node reads pnpm to locate the store for caching, this action must run first.

It can also run install directly, but the common pattern is setup pnpm, then setup-node with cache: pnpm.

Usage

workflow (.yml)
steps:
  - uses: actions/checkout@v4
  - uses: pnpm/action-setup@v4
    with:
      version: 9
  - uses: actions/setup-node@v4
    with:
      node-version: 20
      cache: 'pnpm'
  - run: pnpm install --frozen-lockfile

Inputs

InputDescriptionDefaultRequired
versionpnpm version to install.from packageManager fieldNo
run_installRun pnpm install as part of the action.nullNo
package_json_filepackage.json to read the pnpm version from.package.jsonNo

Notes

Order matters: install pnpm before setup-node so cache: pnpm can find the store.

Common errors

  • Unable to locate executable file: pnpm from setup-node means action-setup ran after setup-node (or not at all). Put it first.

Security and pinning

  • Pin to a commit SHA and pin the pnpm version for reproducible installs.

Alternatives and related

Frequently asked questions

Why does setup-node say it cannot find pnpm?
setup-node needs the pnpm binary to compute the store cache. Run pnpm/action-setup before setup-node.
Running pnpm/action-setup? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card