w3resource

Yarn upgrade-interactive CLI command


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:

yarn upgrade-interactive

[sample yarn upgrade-interactive]

Previous: Yarn unlink and yarn upgrade CLI commands
Next: Yarn version and yarn versions CLI commands



Follow us on Facebook and Twitter for latest update.