yarn icon indicating copy to clipboard operation
yarn copied to clipboard

yarn check: clarify "could be deduped" warning or yarn dedupe documentation

Open akomm opened this issue 5 years ago • 7 comments

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

akomm avatar Sep 24 '19 14:09 akomm

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 :-/.

jonaskello avatar Oct 02 '19 15:10 jonaskello

+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

vfonic avatar Dec 16 '19 11:12 vfonic

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.

akomm avatar Dec 16 '19 11:12 akomm

Seems like yarn check will be removed in yarn v2: https://github.com/yarnpkg/rfcs/pull/106

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

vfonic avatar Dec 16 '19 12:12 vfonic

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

SamDASHUAIB avatar Jun 07 '20 09:06 SamDASHUAIB

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.

akomm avatar Jun 13 '20 19:06 akomm

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

olawalejuwonm avatar Oct 09 '23 16:10 olawalejuwonm