pnpm/action-setup
Install the pnpm package manager, so setup-node can cache the pnpm store.
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-lockfileInputs
| Input | Description | Default | Required |
|---|---|---|---|
version | pnpm version to install. | from packageManager field | No |
run_install | Run pnpm install as part of the action. | null | No |
package_json_file | package.json to read the pnpm version from. | package.json | No |
Notes
Order matters: install pnpm before setup-node so cache: pnpm can find the store.
Common errors
Unable to locate executable file: pnpmfrom 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
versionfor reproducible installs.
Alternatives and related
actions/setup-nodeInstall a specific Node.js version and cache your npm, yarn, or pnpm dependencies.
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.