How to overcome the «This package is not installable via Composer 1.x» error?

02

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

The solution

This means new packages and old unused packages will only be visible to Composer 2 until someone installs them, at which point they will become visible to Composer 1 as well (within 24h as this process happens on a nightly basis).

https://blog.packagist.com/deprecating-composer-1-support#restricted-access-to-unused-packages-via-the-v1-metadata-api-starting-in-may-2021

So, the solution is:

  1. Install the problem package with Composer 2 into a temporary folder
  2. Wait up to 24 hours (you can temporary install the package from the local filesystem)
  3. Install the problem package with Composer 1 into the Magento folder

The «This package is not installable via Composer 1.x» warning will disappear from the package’s page in packagist.org when the package is available for Composer 1:

01