6

I'm using the Composer Dependency Manager for PHP and it won't install the latest version of a package. How can I identify what is holding back composer from installing the latest version?

For example, I have symfony/console in the composer.json versioned as:

"symfony/console": "~3.1",

If I run composer outdated it shows I have symfony/console version 3.1.4 installed, and that version 3.3.5 is available and semver-compatible.

$ composer outdated --no-ansi
symfony/console                    v3.1.4  ! v3.3.5  Symfony Console Component

However, if I perform a dry-run of the update, it will only being me up as far as version 3.2.12.

$ composer update --dry-run --with-dependencies symfony/console
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 2 updates, 0 removals
  - Updating symfony/polyfill-mbstring (v1.2.0) to symfony/polyfill-mbstring (v1.4.0)
  - Installing psr/log (1.0.2)
  - Installing symfony/debug (v3.3.5)
  - Updating symfony/console (v3.1.4) to symfony/console (v3.2.12)

How can I identify what is holding symfony/console back at version 3.2.12 when 3.3.5 is the latest?

yivi
  • 42,438
  • 18
  • 116
  • 138
Courtney Miles
  • 3,756
  • 3
  • 29
  • 47

1 Answers1

15

The prohibits or why-not command will show what is blocking a version.

$ composer prohibits symfony/console 3.3.5
symfony/console  v3.3.5 conflicts  symfony/dependency-injection (<3.3)

Documentation here.

yivi
  • 42,438
  • 18
  • 116
  • 138
Courtney Miles
  • 3,756
  • 3
  • 29
  • 47