-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
The 'get another view on the problem' message shouldn't suggest impossible commands #11690
Comments
Well, technically, this gives you another view of the problem: this error indicates that the root package itself has a requirement forbidding to use this version (which was already there in the other output as |
and the case where your own composer.json forbids it is the only case where the other command will fail early instead of running the solver. |
It crashes with an [InvalidArgumentException], and without -vvv that's all you see. |
I don't understand how else I'm supposed to upgrade that package? There is currently a root requirement for ^9.5 and I want to now upgrade to ^10.1. How else should I do this? |
Well, if you want to update it to 10.1, you need to update your composer.json to change the requirement. |
That's not my point with this issue. Composer outputs a message that says 'Try command |
IMHO a bit borderline to call it bad advice to try a --dry-run command, but nevertheless I like @fredden's proposal in #11691 as the require gives a different view on the problem and is exception free in this case. I tried reproducing and could, but require does not lead to an installable set in my testbed (no idea if this was considered an installable set in the first place as the report is about the suggestion message, not the dependencies.) @joachim-n can you try with the patches from #11691 / #11692 and share how it looks from your end? |
I think you're still missing my point. It is bad advice to recommend a specific command which will crash. |
@joachim-n : Nah, just my opinion. Please apply those specific patches mentioned and report back if they specifically address your point from your point of view and any more commentary you have about those. This would allow me to better help you finding a solution for your issue. |
Ok with latest snapshot the why-not command now outputs:
So I'll call this fixed. Thanks everyone |
My
composer.json
:Output of
composer diagnose
:When I run this command:
I get the following output:
But then this command, as instructed:
produces this output:
And I expected this to happen:
Composer should not tell me to run a command that it then tells me it can't run.
The text was updated successfully, but these errors were encountered: