yarn version

Updates the package version.

yarn version

Starts an interactive session to update the version. Once complete, package.json contains the new version information:

Initial package.json:

{
  "name": "example-yarn-package",
  "version": "1.0.1",
  "description": "An example package to demonstrate Yarn",

Example run:

$ yarn version
info Current version: 1.0.1
question New version: 1.0.2
info New version: 1.0.2
✨  Done in 9.42s.

Updated package.json:

{
  "name": "example-yarn-package",
  "version": "1.0.2",
  "description": "An example package to demonstrate Yarn",

Note: The new version you enter must be a valid semver string.

yarn version --new-version <version>

Updates the package to the specified version.

Example:

$ yarn version --new-version 1.0.3
info Current version: 1.0.2
info New version: 1.0.3
✨  Done in 0.09s.

← Previous: yarn upgrade Next: yarn why