Problem

The Composer installation of an extension in Magento 2 fails.


The following error occurs:


Could not find package ... at any version for your minimum-stability ... Check the package spelling or your minimum-stability


Possible causes

Composer cannot find the sources for the package (Magento extension) you are trying to install. This can have several reasons:

  1. Composer does not know the correct repository to use (e.g. repo.magento.com).
  2. The package artifact (TGZ/ZIP) is not stored in the correct location.
  3. The TGZ or ZIP has been unpacked.

Solutions

  1. To add the repository repo.magento.com to your project, execute this command:
    composer config repositories.<extension> vcs https://repo.magento.com

    Replace the part <extension> with the actual name of the Magento module.

  2. Make sure to store the package artifact (TGZ/ZIP) in a directory that can be accessed by Composer.
  3. Do not unpack (unzip) the package. Just put the TGZ or ZIP file into the directory as is.


Please also follow this article, and check the extension's readme file for setup instructions.