-
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 install --flat - Automatic Choice #1658
Comments
If this is a feature that should be implemented, I can work on it. |
Composer does this really well. It actually always resolves it's own version, and gives you options: You can also set this on the CLI If Composer can't resolve a version, it doesn't have you choose, it just throws an exception and explains why there is no suitable version and forces you to resolve this in your project, or in a dependency. It also resolves the dependency versions every time you run |
For reference: I put together a gulp plugin that examines an install tree prior to installing to look for any discrepancies (aka version conflicts) between modules in the entire tree. https://github.com/shellscape/gulp-version-conflicts is what I came up with and while it's quite quick, it's still another step before we get to running npm or yarn. |
@shellscape I was looking for this same option, but I only see it as being useful for the initial transition to yarn flat mode. As I see it, automated environments should be using FWIW, I did find the unexpected interactivity rather surprising. The ordering of the options also seems somewhat arbitrary. (I didn't look into where the order comes from though.) It would be nice if at least option |
I expected this to work like npm dedupe |
@davidbarratt No, For example, with |
@aij Ah yes. I agree. Let me rephrase, in my opinion it should resolve everything to a single version, and if it can't, it should throw an exception and explain the conflicts rather than making you decide. |
Hi, is there any changes for this? |
Not having this is quite vexing, I actually have to write a script that tails the output of yarn, feeding it to a state machine that can answer those questions automatically to get this feature : C |
Can there at least be a config option to auto-select the first/highest version in the specified range? |
In case it's helpful to anyone, here's the temporary workaround I'm using until this is resolved:
I can't speak to anyone else's use case, but in my case we have a script that generates and commits a new package.json and yarn.lock with the latest versions of a list of modules, after which point yarn.lock is used as you suggest. |
Bash scares the hell out of me so I also made a script to automate this, but in javascript: https://gist.github.com/ds300/158250f230d1825af8a3edd6e7af9cc0 |
In Bower, it uses a config property named
That would tell it to always chose [email protected] when multiple versions could be selected. |
This is preventing adoption of yarn here. Yarn appears to require a tty with |
This feature is necessary to run |
For anyone who would like to try to implement this feature, it might be helpful to write up an RFC and post it over on https://github.com/yarnpkg/rfcs where there can be some discussion as to what the correct behavior should be. 👍 |
For Enterprise Software this a must have feature. We currently also think about to switch back to NPM because this breaks our CI plans. Is there already a RFC or a Plan how to do this ? |
At least sort the damn choices by version, so I can just press first option 100 times and at least see if it's going to work or not. Currently wasting time trying to flatten polymer dependencies. |
Shouldn't this have the high-priority label ? |
please make |
Mind-bottling that this is still an open issue after two years. |
someone should bounty this on gitcoin.co |
+1 for this 🙏🏻 Did anybody find a solution to auto-install latest versions when running --flat? |
Me too, so annoying @@ |
@polizz You still working on this? |
@polizz 🙏🏻 |
I created a brand new sh*t on npm: @gongt/flat-yarn-install |
This also annoys me greatly. So I created https://github.com/DerekZiemba/yarn-V2-workspaces-simple-monorepo/blob/classic/build/yarn-install-flat.js Should be able to drop that file in anywhere. It auto-installs dependencies globally such as There's a readme here https://github.com/DerekZiemba/yarn-V2-workspaces-simple-monorepo#automated |
any updates on this one? |
My takeaway from reading this issue. But this proposal would actually help tremendously without a negative impact:
Can I have this please? :) |
Do you want to request a feature or report a bug?
feature
What is the current behavior?
yarn install --flat
asks the user which version of a module they would like, if there is a conflict.Please mention your node.js, yarn and operating system version.
node v6.8.1
npm v3.10.8
yarn v0.16.1
yarn install --flat
is wonderful in that it asks the users which version of a dep they want to install. However, it would be immensely useful for automation environments, to allow for an option to direct yarn to automatically assume the newest version.The text was updated successfully, but these errors were encountered: