composer require alibabacloud/sdk,PHP版本冲突解决

linux
PHP版本 8.0.8
laravel版本 8.80.0
执行命令 composer require alibabacloud/sdk 出错,提示以下问题

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - tymon/jwt-auth is locked to version 1.0.2 and an update of this package was not requested.
    - tymon/jwt-auth 1.0.2 requires php ^5.5.9|^7.0 -> your php version (8.0.8) does not satisfy that requirement.
  Problem 2
    - fzaninotto/faker is locked to version v1.9.2 and an update of this package was not requested.
    - fzaninotto/faker v1.9.2 requires php ^5.3.3 || ^7.0 -> your php version (8.0.8) does not satisfy that requirement.

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

百度后找到这个文章 分享:[记一次]composer install --ignore-platform-reqs解决版本冲突,
执行命令 composer require alibabacloud/sdk - -ignore-platform-reqs
成功.

所以有个问题, 执行composer require时, 如果里面需要的依赖A已经存在,就会更新这个依赖A的版本吗,还是执行composer require时,会同时执行composer update?

参考分享:[记一次]composer install --ignore-platform-reqs解决版本冲突

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 1

你已经看到了啊,报错,说明composer认为他自己不能决定这些事情。

虽然你说希望他自动更新,但是你的配置文件中,A库要求c库是低版本,B库要求C库是高版本,那么自动更新它也不知自动更新成哪个版本。

所以它抛出问题,让你自己改composer的配置。

1年前 评论

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