重要提示: 此中文文档针对的是 Yarn 的最新版本。
有关 1.x 版本的中文文档,请点击进入 classic.yarnpkg.cn。
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 checkyarn 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

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.