Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show what requires a package in Composer

Tags:

composer-php

My Composer has just told me that a certain package foo/bar is abandoned.

However, it's not listed in my composer.json, so therefore some other package has that as a dependency.

How can I get Composer to show me this?

For example, it might tell me that my root composer.json requires a/b, which requires c/d which in turn requires the offending foo/bar.

like image 610
joachim Avatar asked Apr 19 '17 10:04

joachim


People also ask

How do I check my composer package?

You can run composer show -i (short for --installed ). In the latest version just use composer show .

Where does composer Look for packages?

Composer will look in all your repositories to find the packages your project requires. By default, only the Packagist.org repository is registered in Composer. You can add more repositories to your project by declaring them in composer.

What is require and require Dev in composer?

The require_dev lists packages required for developing this package, or running tests, etc. The dev requirements of the root package are installed by default. Both install or update support the “–no-dev” option that prevents dev dependencies from being installed.


1 Answers

composer show --tree 

Lists your dependencies as a tree. If you pass a package name it will show the dependency tree for that package.

See documentation for more: https://getcomposer.org/doc/03-cli.md#show

like image 77
Pᴇʜ Avatar answered Sep 20 '22 04:09

Pᴇʜ