Important: This documentation covers modern versions of Yarn.
For 1.x docs, see classic.yarnpkg.com.
Yarn
yarn addyarn binyarn cache cleanyarn config getyarn config setyarn config unsetyarn configyarn constraints queryyarn constraints sourceyarn constraintsyarn dedupeyarn dlxyarn execyarn explain peer-requirementsyarn explainyarn infoyarn inityarn installyarn linkyarn nodeyarn npm audityarn npm infoyarn npm loginyarn npm logoutyarn npm publishyarn npm tag addyarn npm tag listyarn npm tag removeyarn npm whoamiyarn packyarn patch-commityarn patchyarn plugin import from sourcesyarn plugin importyarn plugin listyarn plugin removeyarn plugin runtimeyarn rebuildyarn removeyarn runyarn searchyarn set resolutionyarn set version from sourcesyarn set versionyarn stageyarn unlinkyarn unplugyarn upyarn upgrade-interactiveyarn version applyyarn version checkyarn versionyarn whyyarn workspaceyarn workspaces focusyarn workspaces foreachyarn workspaces list

yarn version apply

Plugin

To use this command, first install the version plugin: yarn plugin import version

Apply all the deferred version bumps at once.

Usage

$> yarn version apply

Examples

Apply the version change to the local workspace :

yarn version apply

Apply the version change to all the workspaces in the local workspace :

yarn version apply --all

Options

Definition
Description

--all

Apply the deferred version changes on all workspaces

--dry-run

Print the versions without actually generating the package archive

--prerelease

Add a prerelease identifier to new versions

-R,--recursive

Release the transitive workspaces as well

--json

Format the output as an NDJSON stream

Details

This command will apply the deferred version changes and remove their definitions from the repository.

Note that if --prerelease is set, the given prerelease identifier (by default rc.%d) will be used on all new versions and the version definitions will be kept as-is.

By default only the current workspace will be bumped, but you can configure this behavior by using one of:

  • --recursive to also apply the version bump on its dependencies

  • --all to apply the version bump on all packages in the repository

Note that this command will also update the workspace: references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.