Failed to decode response- zlib_decode()- data error

Edit on GitHub

Description

When running composer install or composer update, you might get the issue Failed to decode response: zlib_decode(): data error .

Solution

Change the composer configuration by running composer config -ge in the terminal and replacing the configuration with the following one

{
    "repositories": {
        "packagist": { "url": "https://packagist.org", "type": "composer" }
    }
}