Table of Contents
Overview
Here are the definitions of both yarn upgrade
and yarn upgarde --latest
.
yarn upgrade
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.
yarn upgrade —latest
The upgrade --latest
command upgrades packages the same as the upgrade command, but ignores the version range specified in package.json. Instead, the version specified by the latest tag will be used (potentially upgrading the packages across major versions).
The package.json file will be updated to reflect the latest version range.
Conclusion
Adding the --latest
flag will ignore the semantic version range in package.json
, so the version upgraded to may not fit that range, so the package.json file is updated to reflect the new latest version.