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 upgrade fails to use latest version in deep dependency case #3115

Closed
alivedise opened this issue Apr 12, 2017 · 6 comments
Closed

yarn upgrade fails to use latest version in deep dependency case #3115

alivedise opened this issue Apr 12, 2017 · 6 comments

Comments

@alivedise
Copy link

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

bug or feature..it depends.

What is the current behavior?
My app depends on package A, and package A depends package B

so in app's package.json it only has package A.
in package A's package.json it is having package B.

Now if package B upgrades from 0.0.1 to 0.0.2,
then we do

  1. yarn upgrade A in app: does not work
  2. yarn upgrade B in app: does not work

package A will still use 0.0.1; if we open yarn.lock to check what happened:
there're two versions of package B in yarn.lock:
B 0.0.1
B 0.0.2

A does not specify the version of B, so it should use 0.0.2, but it does not.
yarn still installs 0.0.1 in B's folder.

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

What is the expected behavior?
If version is not specified, whenever upgrading, using the latest tag.0

Please mention your node.js, yarn and operating system version.
yarn 0.22.0

@OmerHerera
Copy link

@alivedise you are taking about this is issue right? its the same problem I'm having I think 🤔
If its the same issue lets try found how to workflow work when using yarn.
The only solution I found for now its deleting the yarn.lock and run yarn, this way it will get the latest versions, but we lost all the data in the yarn.lock 😢
any suggestions? 💡
Thanks

@OmerHerera
Copy link

👍

@gpoole
Copy link

gpoole commented May 1, 2017

@OmerHerera one other suggestion I have that does seem to work is you can find and delete the entry in the lockfile for the dependency you want to upgrade, before running yarn upgrade. Then when you upgrade the dependant package, Yarn will add the correct entry back in to the lockfile for the dependency as well.

@OmerHerera
Copy link

@gpoole The problem deleting the entry in the yarn.lock file manually its that after that yarn will yield a message that yarn.lock about integrity and create a new yarn.lock file loosing all entries

@gpoole
Copy link

gpoole commented May 14, 2017

Oh yep, I can see an integrity check warning but for me removing a single entry didn't cause the any other entries to be updated, just the missing entry was re-added with a newer version. I also deleted the lockfile to compare results and a whole bunch of entries were changed in the regenerated version, so it does seem to work in 0.23.3.

@arcanis
Copy link
Member

arcanis commented Jul 17, 2017

I'll close this issue in favor of #2394, since it includes a very useful test git repository. I've also shared some thoughts there :)

@arcanis arcanis closed this as completed Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants