[InvalidArgumentException]
Could not find a matching version of package amasty/color-swatches-pro. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (alpha)
To resolve this issue, follow these steps:
1. Make sure you're using the correct composer name when downloading the package. The composer name of the purchased extension can be found in your Amasty.com account in Products tab:
2. If you're trying to retrieve a specific version, make sure this version is valid. The latest version of the main package is listed in the Version column:
3. Check if the Amasty repository is added to your instance. For that, navigate your Magento directory and open the composer.json file. The Amasty repository should be listed under repositories section:
If the Amasty repository is missing, run the below command to add it:
composer config repositories.amasty composer <path>
Where <path> indicates the repository for a specific Magento edition:
- https://composer.amasty.com/community/ - for Community extensions.
- https://composer.amasty.com/enterprise/ - for Enterprise extensions.
4. Make sure the module you're trying to download is available for you. To verify, you can run the following command:
composer show -a amasty/*
It will show all modules available in the Amasty repository for your composer keys. If the repository has been added correctly, the extension you try to retrieve will be displayed in the list:
5. Make sure that you’re requesting the module using the composer keys from the same account that was used for the purchase. The username and password that you use for the authentication to composer repository should coincide with the public and private keys in your Amasty.com account.
To check the pair of keys you're currently using in your Magento, find the auth.json file on your server. The path may differ from server to server, but generally, it is located in the home directory: ~/.composer/auth.json or in your Magento folder. The content of the file should contain composer keys for Amasty repository:
To make sure the keys match the ones generated in your Amasty.com account, log into your Amasty.com account and check the generated keys in License Registration tab. If you're using composer keys from a project you created yourself, you need to open the project in My Production Projects section:
If you're using a project someone else shared with you, and you assigned your module purchases there, this project will be found in the Projects shared with me section of License Registration tab:
If the keys you found do not match those in auth.json file, replace the current keys with the ones from your account:
If there are no keys set in your auth.json file for the Amasty repository, you can add them manually by editing the file, or use this command in the root Magento folder:
composer config --auth http-basic.composer.amasty.com COMPOSER_AMASTY_USERNAME COMPOSER_AMASTY_PASSWORD
Where COMPOSER_AMASTY_USERNAME is the Public Key and COMPOSER_AMASTY_PASSWORD is the Private Key.
6. Verify that your composer keys are enabled in your amasty.com account. The status of the keys is set in the Composer Access Keys section inside your project in License Registration tab:
7. Flush composer cache with the command below: