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

composer why-not/prohibits insists that a package must be installed #8036

Closed
ssaki opened this Issue Mar 14, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@ssaki
Copy link

ssaki commented Mar 14, 2019

I'm trying to composer require a package and it fails due to dependency conflict.
I then try to execute composer why-not vendor/package:version and I'm getting the following message:
"Could not find package vendor/package in your project."

This seems wrong as if I had the package then I succeeded installing it and therefore I don't have to check why it failed installing.

Composer is v1.8.4

@alcohol

This comment has been minimized.

Copy link
Member

alcohol commented Mar 15, 2019

You have to add the package as a requirement in your composer.json. Because your invocation of require failed, your composer.json was reset to its previous state and thus it contains no such requirement. Manually add the requirement and then run why-not (or prohibits).

@alcohol alcohol closed this Mar 15, 2019

@ssaki

This comment has been minimized.

Copy link
Author

ssaki commented Mar 16, 2019

The why-not command has a mandatory argument for the package of interest. Nothing in command's description suggests that what you stated is required. I'd suggest if that's the case that the command description be updated with note/disclaimer about that.

IMO this needs fixing as it's hardly user friendly or even rational (as one passes the package via the mandatory argument anyway), but I have no time to fix it myself right now, so I won't complain too much on closing the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.