yarn upgradeInteractive --latest not showing latest package(s)

Created on 25 Dec 2018  路  6Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
yarn upgradeInteractive --latest doesn't seem to show the latest package versions, or I'm missing out something? For example, "react": "^16.6.3", in package.json, while [email protected] is already available?

I was able to successfully use the command some hours before to update some really old packages. I also tried to delete the node_modules directory incl. yarn.lock file, which unfortunately didn't help to resolve this issue.

$ yarn upgradeInteractive --latest
yarn upgradeInteractive v1.12.3
success All of your dependencies are up to date.
Done in 0.56s.

If the current behavior is a bug, please provide the steps to reproduce.

Please see above.

What is the expected behavior?
I would expect it to offer an upgrade to [email protected] which can be added separately.

Please mention your node.js, yarn and operating system version.
Node.js: 8.11.3
Yarn: 1.12.3
OS: Windows 10

cat-bug good first issue help wanted

Most helpful comment

Here's what I found:

Fail:

yarn upgrade-interactive --latest
yarn upgrade-interactive -L
yarn -L upgrade-interactive

Success:

yarn --latest upgrade-interactive

I use yarn workspaces.

All 6 comments

Are you able to share your package.json and yarn.lock files? It would help in being able to reproduce this issue.

Note also that if 16.7.0 is already installed in node_modules then yarn upgrade won't offer an update, because latest is already installed.

Based on the lock file, I would guess that 16.7.0 is the currently installed version?, but it's not getting updated in package.json afterward. What would be the correct way (if not with this command) to update it to the latest version number in there as well?

yarn upgrade outputs the following:

$ yarn upgrade
yarn upgrade v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Rebuilding all packages...

While yarn upgradeInteractive says:

$ yarn upgradeInteractive
yarn upgradeInteractive v1.12.3
success All of your dependencies are up to date.
Done in 0.26s.

success Saved lockfile.
success Saved 4 new dependencies.
info Direct dependencies
鈹斺攢 [email protected]
info All dependencies
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹溾攢 [email protected]
鈹斺攢 [email protected]
Done in 0.49s.

package.json

  "dependencies": {
    "react": "^16.6.3"
  }

yarn.lock

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"js-tokens@^3.0.0 || ^4.0.0":
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
  integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

loose-envify@^1.1.0, loose-envify@^1.3.1:
  version "1.4.0"
  resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
  integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
  dependencies:
    js-tokens "^3.0.0 || ^4.0.0"

object-assign@^4.1.1:
  version "4.1.1"
  resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
  integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

prop-types@^15.6.2:
  version "15.6.2"
  resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
  integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
  dependencies:
    loose-envify "^1.3.1"
    object-assign "^4.1.1"

react@^16.6.3:
  version "16.7.0"
  resolved "https://registry.yarnpkg.com/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381"
  integrity sha512-StCz3QY8lxTb5cl2HJxjwLFOXPIFQp+p+hxQfc8WE0QiLfCtIlKj8/+5tjjKm8uSTlAW+fCPaavGFS06V9Ar3A==
  dependencies:
    loose-envify "^1.1.0"
    object-assign "^4.1.1"
    prop-types "^15.6.2"
    scheduler "^0.12.0"

scheduler@^0.12.0:
  version "0.12.0"
  resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.12.0.tgz#8ab17699939c0aedc5a196a657743c496538647b"
  integrity sha512-t7MBR28Akcp4Jm+QoR63XgAi9YgCUmgvDHqf5otgAj4QvdoBE4ImCX0ffehefePPG+aitiYHp0g/mW6s4Tp+dw==
  dependencies:
    loose-envify "^1.1.0"
    object-assign "^4.1.1"

Ah, right, this is sort of a known issue. What happens is that the first step that yarn upgrade does is to find any outdated packages versus what is installed (same as running yarn outdated)

If finds nothing outdated (16.7.0 is latest, and that is what is installed) so it exits.

The code never progresses to the point where it would update the package.json reference.

If an older version was still installed, then it would find an outdated package and move on to the modification of pacakge.json and yarn.lock. (it's basically just exiting early because there are no out of date packages).

I think there is an open issue for this case somewhere, but I can't find it at the moment, so I'll tag this issue as a bug.

Hi, I will try to fix it :)

Here's what I found:

Fail:

yarn upgrade-interactive --latest
yarn upgrade-interactive -L
yarn -L upgrade-interactive

Success:

yarn --latest upgrade-interactive

I use yarn workspaces.

Was this page helpful?
0 / 5 - 0 ratings