I am trying to upgrade Magento Version 2.4.1 to 2.4.2 and getting an errors

Magento Open Source 2.4.2 is trying to change the existing order of the require section.
Local order:
Magento Open Source 2.4.2 order:
   ] but it will not be changed. Re-run using --use-default-magento-values or --interactive-magento-conflicts to override with the Magento order.
Updating composer.json for Magento Open Source 2.4.2 ...
./composer.json has been updated
Loading composer repositories with package information                                                                   Updating dependencies (including require-dev)         
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package dealerdirect/phpcodesniffer-composer-installer (locked at v0.5.0, required as ^0.7.0) is satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0] but these conflict with your requirements or minimum-stability.
  Problem 2
    - Conclusion: don't install magento/product-community-edition 2.4.2
    - Conclusion: remove amzn/amazon-pay-and-login-magento-2-module 4.0.4
    - Conclusion: don't install amzn/amazon-pay-and-login-magento-2-module 4.0.4
    - Installation request for magento/product-community-edition 2.4.2 -> satisfiable by magento/product-community-edition[2.4.2].
    - Conclusion: don't install amzn/amazon-pay-and-login-magento-2-module 4.0.4
    - magento/product-community-edition 2.4.2 requires amzn/amazon-pay-and-login-magento-2-module 4.2.0 -> satisfiable by amzn/amazon-pay-and-login-magento-2-module[4.2.0].
    - Can only install one of: amzn/amazon-pay-and-login-magento-2-module[4.2.0, 4.0.4].
    - Can only install one of: amzn/amazon-pay-and-login-magento-2-module[4.2.0, 4.0.4].
    - Installation request for amzn/amazon-pay-and-login-magento-2-module (locked at 4.0.4) -> satisfiable by amzn/amazon-pay-and-login-magento-2-module[4.0.4].

Installation failed, reverting ./composer.json to its original content.

The native 'composer require' command failed, reverting ./composer.json to its original content from before the Magento root update.
  • run composer update with the --use-default-magento-values flag.
    – paj
    Feb 11, 2021 at 8:45
  • @paj, is this the right command to run composer update --use-default-magento-values Mar 10, 2021 at 14:26
  • yes, if you are using the composer update root plugin github.com/magento/composer-root-update-plugin
    – paj
    Mar 10, 2021 at 14:29

2 Answers 2


For fixed the issue in your composer.json

Change order

magento/composer-root-update-plugin, magento/product-community-edition


magento/product-community-edition, magento/composer-root-update-plugin

Update Version

"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"


"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",

  • Is there another fix for this? Mar 10, 2021 at 14:31
  • i used as per answer it was worked for me Mar 11, 2021 at 6:46

Change the require order in composer.json file in your root directory.

enter image description here

Now run the upgrade command "composer require magento/product-community-edition=2.4.2 --no-update"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.