Skip to content

Show outdated packages versions and upgrade all outdated #749

Closed

Description

@MrEfrem

Thank you for your awesome work. This release is very promising.
But it hasn't at least two important commands.
Yarn v1:
yarn outdated - show list outdated packages versions.
yarn upgrade - upgrade all minor versions of outdated packages.
I use it very often.

First I run yarn upgrade to update automatically all minor versions. Then I run yarn outdated and already manually update packages to major versions with changing my sources.
I think so workflow use the most part of people who use yarn or npm.
Why is it not implemented?
Even here @arcanis mentioned that outdated is the main command a year ago yet: #546 (comment)

Activity

  1. added
    enhancement
    on Jan 24, 2020
  2. changed the title [-]Show outdated packages version and upgrade all outdated[/-] [+]Show outdated packages versions and upgrade all outdated[/+] on Jan 24, 2020
  3. deini commented on Jan 24, 2020

    @deini
    Member

    @MrEfrem have you tried upgrade-interactive ?

  4. MrEfrem commented on Jan 24, 2020

    @MrEfrem
    ContributorAuthor

    Oh, yes. It works and what I wanted. Thank you very much. But I spent much time while I tried to find the same commands I used in npm and yarn v1.
    Would be very good if you added link on this command in the migration article and also mentioned there that it replaces outdated and upgrade all packages.
    And maybe it should be added to the Usage section: https://yarnpkg.com/getting-started/usage
    because really those commands are very important.

  5. milesj commented on Jan 24, 2020

    @milesj

    @MrEfrem FWIW, upgrade-interactive has existed in v1 since inception.

  6. MrEfrem commented on Jan 25, 2020

    @MrEfrem
    ContributorAuthor

    @milesj I hadn’t need to search it because those commands I mentioned above worked for me very well in both packages managers. And what do you mean yet? Because it was re-implemented we should wait at least the outdated command?

  7. jakst commented on Jan 30, 2020

    @jakst

    I don't think upgrade-interactive solves the same use case as outdated does.

    In yarn-v1 I regularly use both commands - yarn outdated for a quick scan if there are any packages that need upgrade, and then a couple of rounds of yarn upgrade-interactive to progressively upgrade packages from "guaranteed to not break" to "will probably break something".

    Here are three reasons why yarn outdated is still needed:

    • It is easier to type than yarn upgrade-interactive which is nice for people like me who run yarn outdated several times a day.
    • It does not capture terminal input and is therefore less abrupt than yarn upgrade-interactive. This behaviour also allows yarn outdated to be combined with other commands, like yarn outdated && yarn start.
    • It does not show all packages, and is therefore faster to scan. (Why does the new upgrade-interactive show all packages by the way?)
  8. wesrice commented on Feb 12, 2020

    @wesrice

    I just upgraded from Yarn v1 to v2. I am surprised that commands akin to yarn outdated and yarn upgrade do not exist. This issue is the only place that I've found addressing the topic, so I'll leave my use case here.

    I regularly utilize yarn upgrade for minor and patch upgrades, then run a subsequent yarn outdated to see what major upgrades exist for my projects. I use this as a way of measuring technical debt with the thought that the more major upgrades that exist for my project, the harder it is going to be to maintain the project down the road. At work, I use this as a factor in vouching for feature prioritization. Without yarn upgrade and yarn outdated, I have a much more difficult time doing this.

    Is there an expectation that voids like this in Yarn v2 should be filled via plugins?

  9. robclancy commented on Mar 11, 2020

    @robclancy

    This is super weird :/

  10. danielkcz commented on Apr 2, 2020

    @danielkcz

    Oh my. So everyone is going to meet in this closed issue after painfully realizing that outdated doesn't work and docs don't mention any migration path. Same for the list and who knows what else. That's a rather sad approach :/

    Also, the new upgrade-interactive is fairly confusing. It's not clear that the first column means no update will happen. And it's ugly as hell on Windows.

    image

    But I do like that it allows choosing upgrading minor or major. In the previous iteration, the --latest was somewhat cumbersome.

  11. robrichard commented on Sep 9, 2020

    @robrichard

    Is there a non-interactive way to upgrade all packages that satisfy the current ranges in the package.json? We used to use yarn upgrade to do this.

  12. PutziSan commented on Nov 2, 2020

    @PutziSan

    Is there a non-interactive way to upgrade all packages that satisfy the current ranges in the package.json? We used to use yarn upgrade to do this.

    Is this possible?

    At the moment I find it very difficult to update my packages in a larger workspace. upgrade-interactive shows me about 100 packages (but only 20 at a time and I have to scroll via keyboard arrows), but most of them cannot be upgraded because there is no newer version. The visual selection is very tiring because the lines are very narrow and I often slip in the line. (maybe the UI is only on windows that bad, I don't know)

    When I managed to select everything I want, there is often an error (net gone or the files are blocked by the ide), so that nothing is updated and I have to go through the process again.

    image

  13. nicolabello commented on Nov 17, 2020

    @nicolabello
  14. PutziSan commented on Nov 18, 2020

    @PutziSan

    As far as I know yarn up only works with explicitly naming each dependency.

  15. 11 remaining items

  16. xstable commented on Feb 26, 2022

    @xstable

    Heavily missing the Links to the source-packages we had in "outdated"
    I generally click on those links and check if they describe any "breaking changes" in their changelog / release messages.

    On linux, the navigation isn't smooth. If you move to another line, the whole screen refresh with result in flickering by navigation. You can not move "fast" trough the entries.

    image

    Even a bit confusing.. how can that range be higher as the "latest" version?
    image

  17. jkhaui commented on Mar 5, 2022

    @jkhaui

    You can always use ncu. It uses yarn (probably old version) and shows outdated packages.

    Thanks, this was a great tip. From here it's easy to replicate the old behaviour by adding the following to package.json: scripts: "outdated": "ncu". Still a bit perplexing why this command was removed from yarn.

  18. cdauth commented on Mar 23, 2022

    @cdauth

    I just upgrade to Yarn Berry and I'm super confused about this. In my package.json I have dependencies specified by their major version only. Both using yarn up '**' and yarn upgrade-interactive change my package.json and put the exact version number in there. Also, yarn upgrade-interactive is not a good replacement for yarn outdated, since it does not show the currently installed version of the dependencies (only the specified version range), and it also lists packages that are up to date.

    I need a command that does the same as yarn upgrade: Install the newest versions of all direct and nested dependencies according to the version ranges specified in package.json, without changing the package.json file.

    It seems like what I can do as a workaround right now is delete yarn.lock and then run yarn install again.

  19. mskelton commented on Mar 23, 2022

    @mskelton
    Contributor

    @cdauth There is a recursive option for yarn up that does what you are trying to do: update dependencies in your lockfile without updating the manifest (package.json).

    https://yarnpkg.com/cli/up#options-R%2C-recursive

    To use it, just add -R or --recursive as a flag when calling yarn up.

  20. cdauth commented on Mar 23, 2022

    @cdauth

    @mskelton Thank you, I can confirm that yarn up -R '**' did upgrade everything in the same way that yarn upgrade used to. I must say that I saw this option in the docs but didn't understand its description at all.

  21. alamothe commented on Mar 25, 2022

    @alamothe

    It seems that -R arbitrarily and magically changes behavior of different yarn commands to be more in line with user expectations 🙂 (same thing with foreach, info, but I also fail to understand the logic)

  22. arcanis commented on Mar 25, 2022

    @arcanis
    Member

    If you imagine the commands operate on a tree, by default they'll only run on the roots of these trees. The -R flag makes them follow the whole tree.

    In the case of foreach it's a little special although it's loosely similar, I'd like to re-syntax the cli options to clarify those behaviors.

  23. rohitkandhal commented on Apr 28, 2022

    @rohitkandhal

    For me yarn upgrade-interactive hung up on loading

    2022-04-28_11-13-55

  24. manast commented on Aug 18, 2022

    @manast

    My 2 cents after reading this long thread:
    yarn used to be a drop-in replacement of npm with some nice extra features. Since version 2.0 it is not that thing anymore.

  25. joshuapinter commented on Jul 17, 2023

    @joshuapinter

    You can use glob patterns in it, so for example yarn up "**" would upgrade everything

    I tried this and it didn't work as expected. It updated my package.json file which is not what I'm after. I'm only looking to update my yarn.lock file based on the constraints I have listed in package.json.

    Is there any command that does that?

    The only thing that has worked for me since upgrading to Yarn 2 is deleting the yarn.lock file and running yarn install again.

  26. rudolfbyker commented on Jul 21, 2023

    @rudolfbyker

    Is there any command that does that?

    It seems to me like yarn up -R '**' might be what you want. It's different from yarn up '**' in two ways:

    • It's recursive (dependencies of dependencies are updated)
    • It does not touch package.json
  27. joshuapinter commented on Jul 21, 2023

    @joshuapinter

    @rudolfbyker Damn, I think you're right, based on the docs:

    If -R,--recursive is set the command will change behavior and no other switch will be allowed. When operating under this mode yarn up will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both yarn up and yarn up -R to cover all bases.

    I just tested it and it did exactly what I wanted. Upgrade all packages within the constraints in package.json and only update yarn.lock.

    Thank you for pointing this out!

    My only complaint now is why the command is so unintuitive. :)

  28. Linksku commented on Nov 28, 2023

    @Linksku

    Is there a way to not upgrade major versions with yarn up '**' or yarn up -R '**'? There are a few packages I'm keeping at older versions because the new versions are broken. With yarn upgrade, it ignored the major upgrades.

    With yarn up, seems like my options are:

    1. yarn up '**', then individually install the older versions
    2. yarn upgrade-interactive, then press right + down a few dozen times

    Option 2 would be easier if yarn upgrade-interactive supported toggling all packages, like with Yarn 1.

  29. stefanb2 commented on Feb 2, 2026

    @stefanb2

    Modern yarn up --recursive '**' is NOT a full replacement for Classic yarn upgrade:

    • CORRECT yarn.lock is updated
    • CORRECT package.json is not modified
    • yarn upgrade-interactive still shows the packages with minor/patch upgrades although they are updated in `yarn.lock

    yarn outdated was smarter in this respect: after the upgrade procedure it only showed packages with major upgrades.

    So there is no other way than to use yarn upgrade-interactive, manually select the minor/patch updates and accept that package.json gets modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions