Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to identify what is preventing Composer from installing latest version of a package?

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?

like image 934
Courtney Miles Avatar asked Jul 29 '17 07:07

Courtney Miles


People also ask

How do I update my composer package to latest version?

self-update / selfupdate# To update Composer itself to the latest version, run the self-update command. It will replace your composer.phar with the latest version. If Composer was not installed as a PHAR, this command is not available.

Why is composer not installing?

Why is composer not installing? Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php — –check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

How do you check composer is install or not?

Updating and Uninstalling Composer From there, you can verify Composer's installation by running --version command from the terminal. If the command returns the version code, it means the Composer is installed, and you are ready for the next steps.


1 Answers

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.

like image 185
Courtney Miles Avatar answered Oct 15 '22 20:10

Courtney Miles