正确安装作曲家的依赖

时间:2020-06-16 02:16:15

标签: php laravel doctrine-orm laravel-7

我已经安装了最新版本的laravel(7)。 现在我需要一个特定的软件包:( mercadopago / dx-php)

并引发以下冲突:

Problem 1
    - Installation request for mercadopago/dx-php ^2.0 -> satisfiable by mercadopago/dx-php[2.0.0].
    - Conclusion: remove doctrine/inflector 2.0.3
    - Conclusion: don't install doctrine/inflector 2.0.3

- mercadopago/dx-php 2.0.0 requires doctrine/inflector ^1.0 -> satisfiable by doctrine/inflector[1.0.x-dev, 1.1.x-dev, 1.2.x-dev, 1.3.1, 1.3.x-dev, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.x-dev, v1.0, v1.0.1, v1.1.0, v1.2.0, v1.3.0].

 - Can only install one of: doctrine/inflector[1.4.0, 2.0.3].
    - Can only install one of: doctrine/inflector[1.4.1, 2.0.3].
    - Can only install one of: doctrine/inflector[1.4.2, 2.0.3].
    - Can only install one of: doctrine/inflector[1.4.3, 2.0.3].
    - Can only install one of: doctrine/inflector[1.4.x-dev, 2.0.3].
    - Can only install one of: doctrine/inflector[1.0.x-dev, 2.0.3].
    - Can only install one of: doctrine/inflector[1.1.x-dev, 2.0.3].
    - Can only install one of: doctrine/inflector[1.2.x-dev, 2.0.3].
    - Can only install one of: doctrine/inflector[1.3.1, 2.0.3].
    - Can only install one of: doctrine/inflector[1.3.x-dev, 2.0.3].
    - Can only install one of: doctrine/inflector[v1.0, 2.0.3].
    - Can only install one of: doctrine/inflector[v1.0.1, 2.0.3].
    - Can only install one of: doctrine/inflector[v1.1.0, 2.0.3].
    - Can only install one of: doctrine/inflector[v1.2.0, 2.0.3].
    - Can only install one of: doctrine/inflector[v1.3.0, 2.0.3].
    - Installation request for doctrine/inflector (locked at 2.0.3) -> satisfiable by doctrine/inflector[2.0.3].

我尝试过:

composer depends doctrine/inflector

并抛出:laravel/framework v7.15.0 requires doctrine/inflector (^1.4|^2.0)

如果我理解正确,那么如果我删除了doctrine / inflector [2.0.3]并安装了例如doctrine / inflector [1.4.3],一切都会很好。

composer.lock具有以下内容:

"name": "doctrine/inflector",
            "version": "2.0.3",
            "source": {... etc

已经安装了2.0.3的安装学说/变形器1.4.3的正确方法是什么?

3 个答案:

答案 0 :(得分:3)

似乎一切正常,只需执行

composer require doctrine/inflector:1.4.0

虽然在进行作曲家诊断时会引发以下警告:

require.doctrine / inflector:如果软件包遵循语义版本控制,则应避免确切的版本约束(1.4.3)。

答案 1 :(得分:0)

安装doctrine/inflector:1.4.0给我带来了一些问题,例如反映模型数据库中表的名称。

在我看来,最可行的解决方案是将mecadopago/dx-php安装在另一个目录中,并将此新的自动加载功能添加到应用程序的付款服务中。

答案 2 :(得分:0)

删除文件 composer.lock ,删除文件夹供应商,然后运行 composer require“ mercadopago / dx-php:2.2.1”