requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement

一个大兄弟本地用了 PHP 7.1 进行开发,而我本地是 PHP 7.0, 于是悲剧发生了。

composer install 之后报错

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/annotations v1.5.0 -> satisfiable by doctrine/annotations[v1.5.0].
    - doctrine/annotations v1.5.0 requires php ^7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
  Problem 2
    - Installation request for doctrine/cache v1.7.1 -> satisfiable by doctrine/cache[v1.7.1].
    - doctrine/cache v1.7.1 requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
  Problem 3
    - Installation request for doctrine/collections v1.5.0 -> satisfiable by doctrine/collections[v1.5.0].
    - doctrine/collections v1.5.0 requires php ^7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
  Problem 4
    - Installation request for doctrine/common v2.8.1 -> satisfiable by doctrine/common[v2.8.1].
    - doctrine/common v2.8.1 requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
  Problem 5
    - Installation request for doctrine/dbal v2.6.2 -> satisfiable by doctrine/dbal[v2.6.2].
    - doctrine/dbal v2.6.2 requires php ^7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
  Problem 6
    - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
  Problem 7
    - doctrine/annotations v1.5.0 requires php ^7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
    - doctrine/dbal v2.6.2 requires php ^7.1 -> your PHP version (7.0.18) does not satisfy that requirement.
    - doctrine/dbal 2.5.x-dev requires doctrine/common >=2.4,<2.8-dev -> satisfiable by doctrine/common[2.7.x-dev].
    - backpack/crud 3.2.21 requires doctrine/dbal ^2.5 -> satisfiable by doctrine/dbal[2.5.x-dev, v2.6.2].
    - doctrine/common 2.7.x-dev requires doctrine/annotations 1.* -> satisfiable by doctrine/annotations[v1.5.0].
    - Installation request for backpack/crud 3.2.21 -> satisfiable by backpack/crud[3.2.21].

 

解决方法是

删除 composer.lock 文件,重新执行 composer install,这样就能重新生成 composer.lock 文件了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lxw1844912514

你的打赏就是对我最大的鼓励

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值