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 check: clarify "could be deduped" warning or yarn dedupe documentation #7568

Open
akomm opened this issue Sep 24, 2019 · 7 comments
Open

Comments

@akomm
Copy link

akomm commented Sep 24, 2019

From documentation yarn install will always dedupe.
However, when I run yarn check in my project, I get warnings, that "x" could be deduped from "y" to "z". In fact the different versions of same package(s) are indeed installed locally into the dependencies own node_modules.

For me the message sounds like it is possible to dedupe. And checking the version constraints it does make sense. When I run yarn install, with lockfile or without, it does not matter, the packages are still duplicated.

Docs for dedupe or the message are either wrong, or phrased wrong?

Btw: This are not the root dependencies in my package.json. Adding every of the ~15 duped packages in my package.json sounds bad and also does not resolve the dupes, they are still installed, even I add the packages as root dependency in the compatible version.

yarn: 1.16.0
node: 10.1.0

@jonaskello
Copy link

I have the same issue, yarn check says a bunch of stuff can be deduped. However there seems to be no way to actually do the deduping. Makes no sense to me :-/.

@vfonic
Copy link

vfonic commented Dec 16, 2019

+1

I don't know what to do with yarn check output. It output too much stuff and I don't know how to act on any of it. 🤷‍♂

yarn: 1.21.1
node: 12.13.1

@akomm
Copy link
Author

akomm commented Dec 16, 2019

Having 1000 seemingly unresolvable warnings (at least the documentation and feedback given, makes it so) defeats the purpose of warnings. I don't like having warnings all over the place. You won't see when something new emerges.

@vfonic
Copy link

vfonic commented Dec 16, 2019

Seems like yarn check will be removed in yarn v2:
yarnpkg/rfcs#106

Perhaps this issue could be closed (would be nice to have deprecation warning when running the command in yarn v1 though)

@SamDASHUAIB
Copy link

@akomm
Copy link
Author

akomm commented Jun 13, 2020

Seems like yarn check will be removed in yarn v2:
yarnpkg/rfcs#106

Perhaps this issue could be closed (would be nice to have deprecation warning when running the command in yarn v1 though)

AFAIK yarn 2 is not a replacement of yarn 1. Correct me if it has changed somehow recently. Its like a different tool. In case that goal did not change, deprecation does not make any sense and because other tool does not have this command does not mean the issue here is resolved. Either way, it's also still unclear how to dedupe, since even adding packages as root dependency in a version compatible across packages still end up in the specific versions duplicated as non-root dependency.

For me this solution https://stackoverflow.com/questions/41789887/dont-understand-yarn-check-warning is helpful

As I stated in my very first comment, removing lockfile does not fix it. So you simply had another issue.

@olawalejuwonm
Copy link

I'm also having this issue, any solution please?

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

5 participants