-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 creates unnecessary dupe(s) #7359
Comments
Hi @akomm, did you already try to upgrade Yarn to the latest release 1.16.0? |
@DanielRuf tested it now. Same behavior. |
Did you delte node_modules and yarn.lock? Ok, then please update the version in your issue description. |
I did it multiple times during reproduction. And also in my reproduction steps above there is a blank new project with no lock and node_modules and still the dupe is created. To be sure, I did it now again, with removed yarn.lock & node_modules, yarn install dupe is there. I did the blank project example to reproduce and to prevent some other causes for the dupe, so only the two packages affected are there. |
Ok, thanks for the clarification. |
Just a note: This is probably a major issue for people who use typescript and require From one of Collaborator's: those package's dependencies are auto-generated with For those who encouter this issue, it blocks the code from being compiled and type-checked properly. Seems like a small issue, might get really annoying. I was looking for solutions, similar to composer aliasing (php's package manager) and found this: And could workaround the issue until it is fixed by adding this section into my {
"resolutions": {
"@types/relay-runtime": "^1.3.12"
}
} Hope it helps those with the same issue. |
Closing as working as intended, |
I don't think you've thought through this deeply enough. Neither the logic, nor the consequences of what you are saying.
|
I'll just point you to #3951 (comment) |
Which changes exactly nothing. The argument is, we don't to fix the errors of others (DT maintainers in this case). I don't ask you to fix errors of DT maintainers. I ask you to stop duping for no freaking reason. Does this make sense? BTW, the claim in this comment is very funny, just a sum up: "if we start fixing others mistake, and other package manager also do this but differently, we would end up in a big mess". Wow. This is so wrong. This is the behavior of all package manager I'm aware of, also from other languages: if a constraint is satisfied commonly, its used. How did that turn out to be solved differently on all package managers? Shouldn't there be chaos? Or maybe the outcome is the same, independently, because it freaking makes sense only that way? Likewise, DT is pig-headed. They set dependency as *, which is bonkers. If I don't explicitly set dependencies they have (which I shouldn't, unless its peer), the code will break later. Totally missed the point of package managers and dependency definition concept. A big issue as well. However it does not excuse stupid behavior on yarn side, because it could fix someones mistake, if it did behave differently. What kind of logic is that? |
Hey @akomm. Let me be clear on a few points:
I'll lock this thread since you've made your point clear (in a fairly rude way), and I don't think there's really anything to add. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
yarn installs dupe for vendor dependency, even though its satisfied by an explicit root dependency.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
@types/react-relay@^1.3.12
and@types/relay-runtime@^1.3.12
packages installed@types/react-relay@^1.3.12
does not have anode_modules/@types/[email protected]
(*) dupe (it has dependency on@types/relay-runtime@*
, which is satisfied by the ^1.3.12 explicitly installed)It would make sense and its what npm does for example.
(*) currently its 5.0.0, but it might change if newer versions are release. Its a bit weird configured in regards to dependency on the package maintainer side, I already issued this, but also yarn makes unnecessary dupe.
Please mention your node.js, yarn and operating system version.
yarn: 1.16.0
node: 10.1.0
ubuntu 16.04
The text was updated successfully, but these errors were encountered: