How to fix conflicting component dependencies issues in Magento 2

- Fire development, Magento 2

Magento 2 export CLI

If you see a message informing you about conflicting component dependencies in Magento 2, you’ve come to the right place. Below, we shed light on the essence of the problem, its variations, and possible solutions. More useful tips are available here: Magento 2 Cookbook

The issue

A warning about conflicting component dependencies usually displays if Composer fails to determine components that should be installed or updated. The following two problems typically cause the unpleasant situation we describe in this article:

  1. Component dependency conflicts in Magento 2 are caused by an inappropriately edited Magento 2 composer.json file. 
  2. At the same time, third-party modules may also lead to conflicting component dependencies. If an extension depends on earlier Magento components than the ones installed, you won’t avoid the problem.

Below, you can see a sample message that displays in the case of conflicting component dependencies. However, the message you see may be different because there are a plethora of possible conflicts that can occur.

The solution

Although the resolution of conflicting component dependencies issues in Magento 2 is quite simple, you should be a technical specialist with decent experience and understanding of Composer.

In the example above, you can find a package (magento/sample-data version 0.74.0-beta15) that cannot be upgraded to version 1.0.0-beta. However, other versions support the upgrade. Therefore, you have to upgrade your current version to one of the supported and then try to update to 1.0.0-beta.

You have to edit composer.json to apply any changes. After that, try the readiness check once again.

Component Dependency Check status doesn’t change

We should also describe one more issue in this article. You might have already faced a situation when the status of the Component Dependency Check never change, even when the corresponding issues are fixed.

You have to delete or rename the following files:

  • <magento_root>/var/.update_cronjob_status
  • <magento_root>/var/.setup_cronjob_status 

After that, rerun the Component Manager. That’s it! For further information, follow this link: Component dependency readiness check issues.