Composer 依赖的依赖版本冲突了,请教如何解决?

1. 安装topthink/think-queue packagist.org/packages/topthink/th...

PS D:\phpstudy_pro\WWW\dsmall-deschamps> composer require topthink/think-queue    
Using version ^3.0 for topthink/think-queue
./composer.json has been updated
Running composer update topthink/think-queue
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1                                                                                                                                                                                                                    
    - topthink/think-queue[v3.0.0, ..., v3.0.7] require nesbot/carbon ^2.16 -> satisfiable by nesbot/carbon[2.16.0, ..., 2.64.0].                                                                                              
    - nesbot/carbon[2.27.0, ..., 2.54.0] require symfony/translation ^3.4 || ^4.0 || ^5.0 -> satisfiable by symfony/translation[v3.4.0, ..., v3.4.47, v4.0.0, ..., v4.4.47, v5.0.0, ..., v5.4.14].                             
    - nesbot/carbon[2.55.0, ..., 2.64.0] require symfony/translation ^3.4 || ^4.0 || ^5.0 || ^6.0 -> satisfiable by symfony/translation[v3.4.0, ..., v3.4.47, v4.0.0, ..., v4.4.47, v5.0.0, ..., v5.4.14, v6.0.0, ..., v6.2.0].
    - nesbot/carbon[2.16.0, ..., 2.26.0] require symfony/translation ^3.4 || ^4.0 -> satisfiable by symfony/translation[v3.4.0, ..., v3.4.47, v4.0.0, ..., v4.4.47].                                                           
    - symfony/translation[v5.0.0, ..., v5.4.14] conflict with symfony/yaml <4.4.                                                                                                                                               
    - symfony/translation[v3.4.0, ..., v3.4.47, v4.0.0, ..., v4.4.47] conflict with symfony/yaml <3.4.                                                                                                                         
    - clagiordano/weblibs-configmanager v1.5.0 requires symfony/yaml ^2.8 -> satisfiable by symfony/yaml[v2.8.52].                                                                                                             
    - alibabacloud/client 1.5.31 requires clagiordano/weblibs-configmanager ^1.0 -> satisfiable by clagiordano/weblibs-configmanager[v1.5.0].                                                                                  
    - symfony/translation[v6.0.0, ..., v6.0.14] require php >=8.0.2 -> your php version (7.4.3) does not satisfy that requirement.                                                                                             
    - symfony/translation[v6.1.0, ..., v6.2.0] require php >=8.1 -> your php version (7.4.3) does not satisfy that requirement.                                                                                                
    - alibabacloud/client is locked to version 1.5.31 and an update of this package was not requested.                                                                                                                         
    - Root composer.json requires topthink/think-queue ^3.0 -> satisfiable by topthink/think-queue[v3.0.0, ..., v3.0.7].                                                                                                       

You can also try re-running composer require with an explicit version constraint, e.g. "composer require topthink/think-queue:*" to figure out if any version is installable, or "composer require topthink/think-queue:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

php-fpm 版本:

PS D:\phpstudy_pro\WWW\dsmall-deschamps> php -v 
PHP 7.4.3 (cli) (built: Feb 18 2020 17:29:57) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans

看报错是alibabacloud/client这个包的问题


    好像是这里冲突了
    alibabacloud/client 1.5.31 requires clagiordano/weblibs-configmanager ^1.0 找到包 clagiordano/weblibs-configmanager[v1.5.0]
    clagiordano/weblibs-configmanager v1.5.0 requires symfony/yaml ^2.8 找到包 symfony/yaml[v2.8.52]

    symfony/translation[v5.0.0, ..., v5.4.14] conflict with symfony/yaml <4.4.                                                                       
    symfony/translation[v3.4.0, ..., v3.4.47, v4.0.0, ..., v4.4.47] conflict with symfony/yaml <3.4.

symfony/translation 引用的包 symfony/yaml <4.4
symfony/yaml ^2.8 找到包 symfony/yaml[v2.8.52]
请教下这里改怎么解决冲突?:pray:

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 7

已经给出提示了

file

1年前 评论
微加加的朋友 (楼主) 1年前

先升级下symfony/yaml再安装,因为要求其版本不得小于4.4

1年前 评论

file

我在原包的issue中找到一个类似的问题 github.com/aliyun/openapi-sdk-php-... 准备fork一个他修改的包,然后在composer.json使用replace替换为fork的版本。

1年前 评论
TimJuly

怎么说呢,这就像大家一起喝一碗豆腐脑,A 说要和咸的,B 说要和甜的,俩人冲突了,咋办呢?

要么想办法升级 A,让他依赖甜豆腐脑

要么想办法升级 B,让他依赖咸豆腐脑

或者去掉其中一个依赖,只要 A 或者只要 B

至于选哪种方案,就看代价了。

1年前 评论
微加加的朋友 (楼主) 1年前
deatil 1年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!