pantheon-systems / terminus-composer-plugin

A Terminus plugin for running Composer commands on a Pantheon site
MIT License
14 stars 9 forks source link

Manually set cache directory #6

Open dalin- opened 4 years ago

dalin- commented 4 years ago

I'm getting errors like

Cannot create cache directory /.composer/cache/repo/https---packages.drupal.org-8/, or directory is not writable. Proceeding without cache

Looks like the cache directory can be manually set to a place that's actually writable https://getcomposer.org/doc/03-cli.md#composer-cache-dir

cjboranp commented 9 months ago

Here is an example below. If you put this in your project's composer.json it will set the cache directory (cache-dir) to where you want:

"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "cache-dir": "./.cache",
    "platform": {
        "php": "8.1.0"
    }
}