pnpm version

Bump the package version.

pnpm version <newversion>
pnpm version <major|minor|patch|premajor|preminor|prepatch|prerelease|from-git>
pnpm version -r [--dry-run]

<newversion> can be any of the bump types above or an explicit semver version (e.g. 1.2.3). Workspaces and the workspace: protocol are supported, so cross-references between workspace packages are updated correctly.

When run inside a git repository, pnpm version creates a git commit and an annotated tag for the bump. Commits and tags can be disabled with --no-git-tag-version or gitTagVersion: false in pnpm-workspace.yaml. Git commits and tags are always skipped in recursive mode because multiple packages may be bumped to different versions in a single run.

A single-package bump allows unstaged edits and untracked regular files inside the package when packing excludes them. For example, with "files": ["dist"], you can leave a local notes.txt outside dist. An edit to README.md still blocks the bump because packing always includes it.

Staged changes, deletions, changes outside the package, and changes to ignore rules still block the bump. Recursive bumps require a clean working tree. The same requirement applies when version, packing, or publishing hooks can change what gets packed.

Usage#

pnpm version patch
pnpm version minor
pnpm version major
pnpm version 2.0.0
pnpm version prerelease --preid beta

Recursive releases#

Run with -r and no version argument to consume the pending change intents recorded by pnpm change:

pnpm version -r

This assembles a release plan from the .changeset/*.md intent files and applies it: every package named by an intent is bumped, and so is every package that depends on it through a workspace: range. It then writes changelogs and records the consumed intents in .changeset/ledger.yaml.

When a dependency bump falls outside an explicit workspace range, pnpm updates the range in the dependent package. For example, a major bump from 1.0.0 to 2.0.0 updates workspace:^1.0.0 to workspace:^2.0.0. For a compound range, pnpm keeps the existing range and adds the exact release version with ||. Shorthand ranges such as workspace:^ keep their spelling.

Private packages ("private": true) are bumped without checking the registry for their first release, and their changelog is always written to the committed CHANGELOG.md, even when versioning.changelog.storage is registry.

Preview the plan without touching anything:

pnpm version -r --dry-run

Narrow it to part of the workspace with --filter. The selection is expanded until it settles, so fixed-group companions and dependents whose ranges the bump invalidates are pulled in automatically.

The working tree must be clean unless --dry-run or --no-git-checks is passed. See Release management for the full workflow.

A bump runs the preversion, version, and postversion scripts of each bumped package. The version bump preserves other manifest fields edited by preversion. --dry-run and ignoreScripts skip them.

Outside a workspace, the bare pnpm version -r fails with ERR_PNPM_WORKSPACE_ONLY.

Options#

--preid <prerelease-id>#

The "prerelease identifier" to use as a prefix for the prerelease part of a semver.

pnpm version prerelease --preid beta

--message, -m <message>#

Commit message. Any %s in the message is replaced with the new version. Defaults to %s.

pnpm version patch --message "chore: release v%s"

--tag-version-prefix <prefix>#

Prefix used when creating the git tag. Defaults to the tagVersionPrefix setting, or v (e.g. v1.2.3) when the setting is unset. Set to an empty string to drop the prefix entirely.

--dry-run#

Print what the command would do without changing anything. It works for a single-package bump and for pnpm version -r.

--no-git-tag-version#

Do not create a git commit or tag for the version change.

--no-commit-hooks#

Skip git commit hooks (--no-verify) when committing the version bump.

--sign-git-tag#

Sign the generated git tag with GPG (git tag -s).

--no-git-checks#

Skip the working-tree check before bumping the version. Use this option to proceed after ERR_PNPM_UNCLEAN_WORKING_TREE.

--allow-same-version#

Allow setting the version to the current version. This can be useful for CI pipelines. Without this option, such a bump fails with ERR_PNPM_VERSION_NOT_CHANGED.

--recursive, -r#

Apply the version bump to every package in the workspace (optionally narrowed with --filter). Git commit and tag creation are skipped in recursive mode.

--json#

Output the list of bumped packages in JSON format.

--release-notes <file>#

With the bare pnpm version -r, a file with a summary of the release, written by hand, for a registry declared with serverType: pnpr. The summary goes above the release notes composed from the change intents: the notes of the whole release, or the package's own notes when the release has one package. pnpm publish then sends them as they were composed. The command fails when the file does not exist, when no release of the plan publishes to such a registry, or when versioning.changelog.storage is not registry.