Composer doesn’t allow me to update the module to the latest version. Is there a solution for it?

Composer doesn’t allow me to update the module to the latest version. Is there a solution for it?

While updating Amasty extensions via composer, you may encounter a Nothing to install, update or remove message, as if there are no updates for the modules.


There are several possible reasons why the composer is not fetching the latest version of the module.
  1. The module package might be loaded from composer cache.
  2. There may be dependencies that need to be updated along with the main package.
  3. The amasty/base module might not be updated, which can prevent other dependencies from updating via composer update amasty/* command.
To resolve it and successfully retrieve the latest version, follow the steps below:

1. If you're trying to update the modules using this command:

composer update amasty/*

There's a chance the latest versions are not downloaded since amasty/base module is not up-to-date. Due to that, other dependencies cannot be updated either. To check the version of amasty/base you're currently on, use this command:

composer show -l amasty/base

The output should be as follows:



Here, the current version is specified in the versions field and the latest version — in the latest field. In case amasty/base is not up-to-date, require the latest version:

composer require amasty/base:x.x.x

Then, try the update command again:

composer update amasty/*

2. If you download a specific module and composer returns Nothing to install, update or remove, you can require the exact version of the module using this command:

composer require amasty/module-name:^x.x.x

Still, the composer might show another error, stating that The required version doesn’t match your minimum stability or that Your requirements couldn’t be resolved to an installable set of packages:


The issue occurs since the package version you’re trying to install requires an update of other dependent packages. An easy fix is to update the dependent packages to the latest available or latest required version. In the example above, we need to update amasty/base to 1.12.0 or higher. So, we require the modules at the same time, until the dependency issue is resolved:

composer require amasty/module-elastic-search:1.12.0 amasty/base:1.12.0

If there are other dependencies that require to be updated, you can add them to this command as well.

Another solution to it is to require the main package (amasty/module-elastic-search) and specify that it should be updated together with all dependencies:

composer require amasty/module-name:^x.x.x --update-with-dependencies

or

composer require amasty/module-name:^x.x.x --update-with-all-dependencies