我如何只更新一个作曲家依赖关系? [英] How would I only update one composer dependency?

查看:53
本文介绍了我如何只更新一个作曲家依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望

composer update videlalvaro/php-amqplib

只会更新一个依赖项,而不是更新所有依赖项。

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

我缺少什么?

PS:此依赖项定义为 videlalvaro / php-amqplib: 2.2.0 composer.json

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

PPS:使用的作曲者版本为 3da05c68f9561fa822c522b1815435ff990493ff 2013-10-02 14 :25:06

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

PPPS:实际输出:

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].


推荐答案

命令 composer update videlalvaro / php-amqplib 只会更新该依赖项。但是,它不会禁用Composer所做的其他依赖项检查。

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

该错误消息所抱怨的是您的系统上没有lib-icu。显然,这可以通过安装PHP Intl扩展来解决。

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.

如果您在需要PHP 5.5的项目中进行了作曲家更新,您会看到类似的问题。 ,降级为PHP 5.4,然后针对不需要PHP 5.5的单独要求运行composer更新。即使您不会更新需要PHP 5.5的需求,该软件包的要求也无法解决,因此Composer将会失败。

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.

即使您只是尝试将 videlalvaro / php-amqplib 更新到最新版本,对 symfony / icu 未被满足,因此作曲者更新失败。

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.

编辑

为了对您有所帮助,我猜您自从您上一次进行更新以来就重新安装了PHP,并且已删除或忘记安装PHP Intl扩展。 Composer无法令人满意地满足您的composer.json设置的要求,因此默认情况下不执行任何操作,而不是故意在不满足要求的情况下进行更新。

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.

因此,基本上,您需要安装运行现有已安装软件所需的PHP扩展,然后Composer将能够更新您要更新的单个软件包,并满足其他软件包的要求。

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.

这篇关于我如何只更新一个作曲家依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆