close
The Wayback Machine - https://web.archive.org/web/20200831161710/https://github.com/yarnpkg/yarn/issues/6852
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ndresx opened this issue Dec 25, 2018 · 6 comments
Open

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

ndresx opened this issue Dec 25, 2018 · 6 comments

Comments

@ndresx
Copy link

@ndresx ndresx commented Dec 25, 2018

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 react@16.7.0 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 react@16.7.0 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

@ghost ghost assigned imsnif Dec 25, 2018
@ghost ghost added the triaged label Dec 25, 2018
@rally25rs
Copy link
Contributor

@rally25rs rally25rs commented Jan 4, 2019

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

@rally25rs
Copy link
Contributor

@rally25rs rally25rs commented Jan 4, 2019

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.

@rally25rs rally25rs added needs-confirmation and removed triaged labels Jan 4, 2019
@ndresx
Copy link
Author

@ndresx ndresx commented Jan 4, 2019

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
└─ react@16.7.0
info All dependencies
├─ js-tokens@4.0.0
├─ prop-types@15.6.2
├─ react@16.7.0
└─ scheduler@0.12.0
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"
@rally25rs
Copy link
Contributor

@rally25rs rally25rs commented Jan 7, 2019

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.

@rjchirinos
Copy link

@rjchirinos rjchirinos commented Jan 9, 2019

Hi, I will try to fix it :)

@anri-asaturov
Copy link

@anri-asaturov anri-asaturov commented Jan 25, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
@rally25rs @imsnif @anri-asaturov @rjchirinos @ndresx and others
You can’t perform that action at this time.