One possibility is that you have un-resolvable dependencies:
Your requirements could not be resolved to an installable set of
packages.
As the others have mentioned you may need to just run composer install
and wait. If the dependencies cannot be resolved, composer will scan every possible option - which may take a long time.
If you have lots of dependencies - you might want to try and remove everything from composer.json
first, then add them back in one at a time to discover which ones are failing to resolve.
When composer install
eventually finishes - read the output carefully, and see if there are missing dependencies you need to install manually.
In my case I was only trying to install a single package. This was my composer.json
:
{
"require-dev": {
"phpunit/phpunit": "^8"
}
composer install
took a long time to run but eventually reported:
Problem 1
- phpunit/phpunit 8.5.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.5.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/phpunit ^8 -> satisfiable by phpunit/phpunit[8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.3.0, 8.3.1, 8.3.2, 8.3.3, 8.3.4, 8.3.5, 8.4.0, 8.4.1, 8.4.2, 8.4.3, 8.5.0, 8.5.1, 8.5.2].
So I installed the missing dependency - PHP extension dom:
sudo apt install php-dom
Next time I ran composer install
it completed successfully.