Php 更新到composer 2.0后TravisCI版本矩阵出现问题
升级到Composer 2.0后,我在执行Travis时遇到了问题 我有一个TYPO3扩展,我想用多个TYPO3版本测试它。直到昨天,我还可以使用Php 更新到composer 2.0后TravisCI版本矩阵出现问题,php,composer-php,typo3,travis-ci,typo3-extensions,Php,Composer Php,Typo3,Travis Ci,Typo3 Extensions,升级到Composer 2.0后,我在执行Travis时遇到了问题 我有一个TYPO3扩展,我想用多个TYPO3版本测试它。直到昨天,我还可以使用composer require nimut/typo3 complete:$typo3\u VERSION(来自版本矩阵) 更新后,我得到了以下错误/信息 Cannot update only a partial set of packages without a lock file present. Installation failed, rev
composer require nimut/typo3 complete:$typo3\u VERSION
(来自版本矩阵)
更新后,我得到了以下错误/信息
Cannot update only a partial set of packages without a lock file present.
Installation failed, reverting ./composer.json to its original content.
由于我的存储库中没有composer.lock,我首先使用composer安装测试了我的管道,然后进行了更新。这一切都很好,直到我转到下一个版本,因为依赖项不同,并且composer安装中的composer.lock无法更新其他依赖项
我已经用composer require--dev nimut/typo3 complete:^10.4--
Problem 1
- typo3/testing-framework is locked to version 4.15.2 and an update of this package was not requested.
- typo3/testing-framework 4.15.2 requires typo3/cms-backend ^9.3 -> found typo3/cms-backend[v9.3.0, ..., 9.5.x-dev] but it conflicts with another require.
Problem 2
- symfony/http-client v5.1.7 requires symfony/http-client-contracts ^2.2 -> found symfony/http-client-contracts[dev-main, dev-master, v2.2.0, v2.3.1, 2.3.x-dev (alias of dev-master)] but it conflicts with another require.
- nunomaduro/phpinsights v1.14.0 requires sensiolabs/security-checker ^6.0 -> satisfiable by sensiolabs/security-checker[v6.0.3].
- sensiolabs/security-checker v6.0.3 requires symfony/http-client ^4.3|^5.0 -> satisfiable by symfony/http-client[v5.1.7].
- nunomaduro/phpinsights is locked to version v1.14.0 and an update of this package was not requested.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
-W
选项是我正在尝试的选项。我试过-w
和-w
,到目前为止运气都不好
我还不知道如何解决这个问题,你的意见可能会很有帮助
链接到.travis.yml
链接到Travis Build,在那里进行测试。
已在composer的GitHub存储库中报告并修复了与composer require
有关的问题。它将在即将发布的Composer 2.0.2中发布。因此,您可以升级到2.0.2,它应该可以解决您的问题
要解释解决方案失败的原因,请执行以下操作:
composer require nimut/typo3 complete:$typo3\u VERSION
编辑composer.json文件以添加“nimut/typo3 complete”:“^$typo3\u VERSION”
。然后它运行composer update nimut/typo3 complete
,或者(在composer 1.x或2.0.2+)如果还没有锁文件,则运行普通的composer update
如果先在没有锁文件的情况下运行composer安装
,则会执行composer更新
,因为没有锁文件。随后的composer require
仍然编辑json文件,现在运行composer update nimut/typo3 complete
,因为有一个锁文件。即使启用了所有依赖项选项,运行普通的composer更新可能会产生不同的结果,甚至会产生冲突,因为您将更新仅限于新包及其依赖项。这太不可思议了,我对某些项目的复杂性以及您能够以何种速度查明问题并加以解决感到非常惊讶!干得好!