Interactive Package upgrades with Yarn CLI
In the last tutorial we covered how you can unlink a package, we also showed you how to upgrade your dependencies.
The tutorial that you are about to about to read will give you a guide on how to update a package interactively.
yarn upgrade-interactive [--latest]
The yarn upgrade-interactive command will require the same parameters as yarn upgrade, and it also functions the same way that the upgrade command does.
It will display the outdated packages before it performs any upgrade, this allows the user to select which packages to upgrade. Yarn respects the version changes that are in the package.json file when determining the version to upgrade to.
The yarn upgrade-interactive can be considered a combination of the yarn outdated and yarn upgrade [package..] commands. Where the yarn outdated will display the list of outdated packages and the yarn upgrade will be used to upgrade the desired packages, the yarn upgrade-interactive command will display the same outdated package list and then enables you to immediately chose which ones you want to upgrade.
--latest : When you add the --latest flag, yarn will ignore the specified version ranges in the package.json file and use the version tagged latest in the registry instead.
Here is an example:
[sample yarn upgrade-interactive]
Previous:
Managing Symlinks and upgrading Packages with Yarn CLI.
Next:
Yarn version and versions CLI Commands.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/yarn/yarn-upgrade-interactive-cli-command.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics