Skip to content
Advertisement

How would I only update one composer dependency?

I expected that

composer update videlalvaro/php-amqplib

would only update one dependency, but instead of that it updates all.

What am I missing?

PS: this dependency is defined as "videlalvaro/php-amqplib": "2.2.0" in composer.json

PPS: the composer version used is 3da05c68f9561fa822c522b1815435ff990493ff 2013-10-02 14:25:06

PPPS: the actual output:

$ composer.phar update videlalvaro/php-amqplib --no-dev
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
    - symfony/icu v1.2.0 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
    - Installation request for symfony/icu == 1.2.0.0 -> satisfiable by symfony/icu[v1.2.0].

Advertisement

Answer

The command composer update videlalvaro/php-amqplib does just update that dependency. However it doesn’t disable the other dependency checking that Composer does.

What the error message is complaining about is that the lib-icu is not available on your system. Apparently this would be solved by installing the PHP Intl extension.

You would see similar issues if you did a composer update on a project that required PHP 5.5 in one of it’s requires, downgraded to PHP 5.4 and then ran composer update on a separate require, that didn’t require PHP 5.5. Even though you wouldn’t be updating the require that needs PHP 5.5, the requirements for that package would not be resolvable, and so Composer would fail.

In your case, even though you’re just trying to update videlalvaro/php-amqplib to the latest version, the requirements for symfony/icu aren’t met, and so the composer update fails.

Edit

To try to be helpful, I’m guessing you re-installed PHP since you last did an update, and either removed or forgot to install the PHP Intl extension. Composer can’t satisfactorily satisfy the requirements your composer.json is setting, and so is defaulting to doing nothing, rather than knowingly doing an update where the requirements aren’t met.

So basically, you need to install the PHP extensions that are required for your existing installed software to run, and then Composer will be able to update the single package you want to update, as well as meet the requirements for the other packages.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement