Issue
While using composer, users may experience memory exhaustion issues and/or problems with requested packages not being found.
Resolution
Composer now has a built in function for clearing the cache which can be run using the following:
~/composer clear-cache
If clearing the cache doesn’t work correctly or you need to manually clear the cache, this can be done by running the following in the root of your project:
rm -rf ~/.composer/cache/*
Cause
Composer’s cache works well in that it does help to speed up your composer workflow, however it does tend to get bloated quite quickly.