1 minute • 2020-09-18
    Composer cache

    When working with repositories that utilize composer packages, sometimes you might get into a situation, where you expect a package to be present, but a different version is what exists in your vendor folder. Even if you run

    composer update

    things still do not update.

    Composer implements a cache, where packages are stored for a period of time, so that any install, update etc. commands do not download packages that have already been downloaded. It speeds things up and saves on bandwidth.

    To clear the composer cache, all you have to do is run:

    composer clearcache

    It has only happened to me once, but you might encounter the same problem yourself.

    Clearing the cache ensures that you are downloading the packages that are listed in your composer.json file.

Nikolaos Dimopoulos
Nikolaos Dimopoulos

Boldly goes where no other coder has gone before.... and other ramblings