Yarn Version [patched] -

The yarn version command is a built-in Yarn (Classic) CLI command used to manage a project's version number. It automates the process of updating the version field in the package.json file, creating a corresponding Git tag, and optionally committing the change.

| Error | Likely Cause | Solution | | :--- | :--- | :--- | | Working tree has uncommitted changes | Git repository has modified files. | Commit or stash changes before running. | | Not a git repository | Project not initialized with Git. | Run git init . Use --no-git-tag-version to skip. | | Invalid version | --new-version value is not semantic. | Use valid semver (e.g., 1.2.3 , 2.0.0-beta.1 ). | yarn version

# Starting version: 1.0.0 yarn version --patch package.json version becomes 1.0.1 Git tag: v1.0.1 Bump minor version yarn version --minor package.json version becomes 1.1.0 Bump major version yarn version --major package.json version becomes 2.0.0 Set explicit version yarn version --new-version 3.0.0-beta.1 The yarn version command is a built-in Yarn