I installed a package with composer, and it installed many other packages as dependencies.
Now I uninstalled the main package with composer remove packageauthor/packagename
, but all the old dependencies were not removed. I expected composer to clean up and only keep packages that are required according to composer.json
and their dependencies.
How can I force composer to clean up and remove all unused packages ?
Best Answer
The right way to do this is:
I must admit the flag here is not quite obvious as to what it will do.
Update
As of v1.0.0-beta2
--update-with-dependencies
is the default and is no longer required.