问题:
I installed a package with composer, and it installed many other packages as dependencies. 我安装了一个包含composer的包,并且它安装了许多其他包作为依赖项。
Now I uninstalled the main package with composer remove packageauthor/packagename
, but all the old dependencies were not removed. 现在我使用composer remove packageauthor/packagename
卸载了主包,但是没有删除所有旧的依赖项。 I expected composer to clean up and only keep packages that are required according to composer.json
and their dependencies. 我希望composer能够清理并只保留根据composer.json
及其依赖项所需的包。
How can I force composer to clean up and remove all unused packages ? 如何强制编写器清理并删除所有未使用的包?
解决方案:
参考一: https://en.stackoom.com/question/1ozw0参考二: https://stackoom.com/question/1ozw0