問題:
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