--- id: docs_cli_upgrade guide: docs_cli layout: guide additional_reading_tags: ["cli-add", "cli-tag", "dependencies-versions", "cli-upgrade-interactive"] --- {% include vars.html %}
Upgrades packages to their latest version based on the specified range.
##### `yarn upgrade [package | package@tag | package@version | --scope @scope]... [--ignore-engines] [--pattern]` This command updates dependencies to their latest version based on the version range specified in the `package.json` file. The `yarn.lock` file will be recreated as well. Optionally, one or more package names can be specified. When package names are specified, only those packages will be upgraded. When no package names are specified, all dependencies will be upgraded. `[package]` : When a specified package is only a name then the latest matching version of this package will be upgraded to. `[package@tag]` : When a specified package contains a tag then the specified tag will be upgraded to. [Tag]({{url_base}}/docs/cli/tag#toc-what-are-tags) names are chosen by project maintainers, typically you use this command to install an experimental or long term support release of an actively developed package. The tag you choose will be the version that appears in your `package.json` file. `[package@version]` : When a specified package contains a version then the specified version will be upgraded to. The `package.json` dependency reference will also be changed to match this specified version. You can use any [SemVer]({{url_base}}/docs/dependency-versions#toc-semantic-versioning) version number or range. `--ignore-engines` : This flag can be used to skip the engines check. Examples: ```sh yarn upgrade yarn upgrade left-pad yarn upgrade left-pad@^1.0.0 yarn upgrade left-pad grunt yarn upgrade @angular ``` `yarn upgrade --pattern