Magento 2 upgrade and composer issues

Likes (1)   Dislikes (0)  
  (2 reviews)

While upgrading a Magento 2 website via composer we face several issues, and some of your existing extensions are throwing errors while running the composer update command like “Your requirements could not be resolved to an installable set of packages”.

We will try to understand and overcome these issues in this tutorial.

ShellScript
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires amzn/amazon-payments-magento-2-plugin 5.1.0 -> satisfiable by amzn/amazon-payments-magento-2-plugin[5.1.0].
    - amzn/amazon-payments-magento-2-plugin 5.1.0 requires php ~7.0.13||~7.1.0||~7.2.0||~7.3.0||~7.4.0 -> your php version (8.1.10) does not satisfy that requirement.
  Problem 2
    - tactconnect/easypost 1.0.2 requires php ~7.0|~7.1|~7.2|~7.3|~7.4 -> your php version (8.1.10) does not satisfy that requirement.
    - tactconnect/easypost[1.0.0, ..., 1.0.1] require php ~5.5.0|~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0 -> your php version (8.1.10) does not satisfy that requirement.
    - Root composer.json requires tactconnect/easypost ^1.0 -> satisfiable by tactconnect/easypost[1.0.0, 1.0.1, 1.0.2].

Understanding the Error Message Produced by Composer

Here we can clearly see that amzn/amazon-payments-magento-2-plugin 5.1.0 is not supported in our upgraded Magento 2 version. Here we are upgrading the Magento version from 2.4.3 to 2.4.5. The extension was working well in 2.4.3 but was not able to update to 2.4.5 with that as we have upgraded PHP to 8.1.

amzn/amazon-payments-magento-2-plugin 5.1.0 requires php ~7.0.13||~7.1.0||~7.2.0||~7.3.0||~7.4.0 -> your php version (8.1.10) does not satisfy that requirement.

The above line clearly says that our current PHP version is at 8.1 and the extension supports upto PHP 7.*

So how could we check for the new version of the extension’s availability that is compatible with PHP8.1? We could use “composer outdated amzn/amazon-payments-magento-2-plugin” the command in our terminal to check for the same.

This command’s output will give us information like the current version mentioned in the root composer.json, the latest version available in packagist repository, and what are its internal requirements as given below. Learn more about composer outdated here.

composer outdated amzn/amazon-payments-magento-2-plugin
Info from https://repo.packagist.org: #StandWithUkraine
name     : amzn/amazon-payments-magento-2-plugin
descrip. : Official Magento2 Plugin to integrate with Amazon Pay
keywords :
versions : * 5.1.0  ====== current version available in root composer.json file
latest   : 5.14.1  ======= the latest version available in packagist repository
type     : magento2-module
license  : Apache License 2.0 (Apache-2.0) (OSI approved) https://spdx.org/licenses/Apache-2.0.html#licenseText
homepage :
source   : [git] https://github.com/amzn/amazon-payments-magento-2-plugin.git 0af5e310e1b67ca257305cb23bab92802912087e
dist     : [zip] https://api.github.com/repos/amzn/amazon-payments-magento-2-plugin/zipball/0af5e310e1b67ca257305cb23bab92802912087e 0af5e310e1b67ca257305cb23bab92802912087e
path     : vendor/amzn/amazon-payments-magento-2-plugin
names    : amzn/amazon-payments-magento-2-plugin, amzn/amazon-pay-and-login-magento-2-module, amzn/amazon-pay-and-login-with-amazon-core-module, amzn/amazon-pay-module, amzn/amazon-pay-v2-magento-2-module, amzn/login-with-amazon-module
Attention: This package is abandoned and no longer maintained. The author suggests using the amzn/amazon-pay-magento-2-module package instead.

autoload
files
psr-4
Amazon\Pay\ => .

requires
amzn/amazon-pay-api-sdk-php ^2.2
aws/aws-php-sns-message-validator ^1.5
magento/framework ^102.0||^103.0
magento/module-backend ^101.0||^102.0
magento/module-checkout ^100.0
magento/module-config ^101.0
magento/module-customer ^102.0||^103.0
magento/module-developer ^100.0
magento/module-eav ^102.0
magento/module-payment ^100.0
magento/module-quote ^101.0
magento/module-sales ^100.0||^101.0||^102.0||^103.0
magento/module-store ^101.0
php ~7.0.13||~7.1.0||~7.2.0||~7.3.0||~7.4.0

requires (dev)
guzzlehttp/guzzle ^6.2.0
phpunit/phpunit 4.1.0

replaces
amzn/amazon-pay-and-login-magento-2-module *
amzn/amazon-pay-and-login-with-amazon-core-module *
amzn/amazon-pay-module *
amzn/amazon-pay-v2-magento-2-module *
amzn/amazon-payments-magento-2-plugin *
amzn/login-with-amazon-module *

From the output above we can use the latest available version suggested in our composer.json file. But there is also one Attention: This package is abandoned and no longer maintained. The author suggests using the amzn/amazon-pay-magento-2-module package instead.

Applying the Solution. Upgrading the package to Latest stable version.

So we should go ahead and replace the extension with the new one instead. Similarly, we can check for all other extensions giving problems in the initial composer error and check their available updates and use them instead.

So let’s check for the new suggested extension. Using composer show command to see the detailed information regarding any package.

composer show amzn/amazon-pay-magento-2-module -a
composer show amzn/amazon-pay-magento-2-module -a
name     : amzn/amazon-pay-magento-2-module
descrip. : Official Magento2 Plugin to integrate with Amazon Pay
keywords :
versions : dev-master, 5.14.1, 5.14.0, 5.13.1, 5.13.0, 5.12.0, 5.11.1, 5.11.0, 5.10.0, 5.9.1, 5.9.0, 5.8.0, 5.7.1, 5.7.0, 5.6.0, 5.5.1, 5.5.0, 5.4.0, 5.3.0, 5.2.0, 5.1.0, 5.0.1, 5.0.0, 4.2.0, 4.1.4, 4.1.3, 4.1.2, 4.1.1, 4.1.0, 4.0.x-dev, 4.0.4, 4.0.3, 4.0.2, 4.0.1, 4.0.0, 3.9.0, 3.8.0, 3.7.4, 3.7.3, 3.7.2, 3.7.1, 3.7.0, 3.6.2, 3.6.1, 3.6.0, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.3, 3.4.2, 3.4.1-p3, 3.4.1-p2, 3.4.1, 3.4.0, 3.3.3, 3.3.2, 3.3.1, 3.2.13, 3.2.12, 3.2.11, 3.2.10, 3.2.9, 3.2.8, 3.2.7, 3.2.6, 3.2.4, 3.2.2, 3.2.1, 3.2.0, 3.1.7, 3.1.6, 3.1.5, 3.1.4, 3.0.x-dev, 3.0.0, 2.x-dev, 2.3.1, 2.2.16, 2.1.x-dev, 2.1.4, 2.1.3, 2.0.16, 2.0.15, 1.x-dev, 1.3.0, 1.2.8, 1.2.7, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.10, 1.0.9, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, dev-V2checkout-1.2.x
type     : magento2-module
license  : Apache License 2.0 (Apache-2.0) (OSI approved) https://spdx.org/licenses/Apache-2.0.html#licenseText
homepage :
source   : [git] https://github.com/amzn/amazon-payments-magento-2-plugin.git 0e9aa6e3fafb5517c3bdb6ca10dcd3e25de4474f
dist     : [zip] https://api.github.com/repos/amzn/amazon-payments-magento-2-plugin/zipball/0e9aa6e3fafb5517c3bdb6ca10dcd3e25de4474f 0e9aa6e3fafb5517c3bdb6ca10dcd3e25de4474f
names    : amzn/amazon-pay-magento-2-module, amzn/amazon-pay-and-login-magento-2-module, amzn/amazon-pay-and-login-with-amazon-core-module, amzn/login-with-amazon-module, amzn/amazon-pay-module, amzn/amazon-pay-v2-magento-2-module, amzn/amazon-payments-magento-2-plugin

support
issues : https://github.com/amzn/amazon-payments-magento-2-plugin/issues
source : https://github.com/amzn/amazon-payments-magento-2-plugin/tree/5.14.1

autoload
files
psr-4
Amazon\Pay\ => .

requires
php ~7.0.13||~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.0.0||~8.1.0
magento/framework ^102.0||^103.0
magento/module-sales ^100.0||^101.0||^102.0||^103.0
magento/module-checkout ^100.0
magento/module-payment ^100.0
magento/module-eav ^102.0
magento/module-developer ^100.0
magento/module-config ^101.0
magento/module-backend ^101.0||^102.0
magento/module-quote ^101.0
magento/module-customer ^102.0||^103.0
magento/module-store ^101.0
magento/module-catalog ^103.0||^104.0
magento/module-configurable-product ^100.0
magento/module-directory ^100.0
magento/module-media-storage ^100.0
magento/module-paypal ^100.0||^101.0
phpseclib/phpseclib ~2.0||~3.0
amzn/amazon-pay-api-sdk-php ^2.2
aws/aws-php-sns-message-validator ^1.5

requires (dev)
guzzlehttp/guzzle ^6.2.0

replaces
amzn/amazon-pay-and-login-magento-2-module *
amzn/amazon-pay-and-login-with-amazon-core-module *
amzn/login-with-amazon-module *
amzn/amazon-pay-module *
amzn/amazon-pay-v2-magento-2-module *
amzn/amazon-payments-magento-2-plugin *

Now remove the old extension and add the new one to composer.json by requiring them.

ShellScript
composer remove amzn/amazon-payments-magento-2-plugin --no-update
composer require amzn/amazon-pay-magento-2-module --no-update

Last minute tasks to do

After requiring all new versions of the outdated packages we can run composer update again to actually pull the latest packages and update out source code. Remember we applied –no-update while requiring, this will just require the said package with the appropriate version but not pull the code from repository. Hence we have to run upgrade once again after all changes are done and we are satisfied with that.

Leave a Comment

Share via
Copy link
Powered by Social Snap