【问题标题】:Installation via Composer receives an error with certain dependencies通过 Composer 安装收到具有某些依赖项的错误
【发布时间】:2019-03-04 13:28:43
【问题描述】:

我正在尝试通过 composer 初始化我的 symfony 项目。 但我收到以下错误:

Problem 1
    - Installation request for pugx/shortid-php 1.* -> satisfiable by pugx/shortid-php[1.0.x-dev].
    - pugx/shortid-php 1.0.x-dev requires php ^7.1 -> your PHP version (5.4.45) does not satisfy that requirement.
Problem 2
    - Installation request for pugx/shortid-doctrine 1.* -> satisfiable by pugx/shortid-doctrine[1.0.x-dev].
    - pugx/shortid-doctrine 1.0.x-dev requires pugx/shortid-php ^0.5 -> satisfiable by pugx/shortid-php[v0.5.0] but these conflict with your requirements or minimum-stability.
Problem 3
    - Installation request for pugx/shortid-doctrine-bundle 1.* -> satisfiable by pugx/shortid-doctrine-bundle[1.0.x-dev].
    - pugx/shortid-doctrine-bundle 1.0.x-dev requires pugx/shortid-doctrine ^0.4 -> satisfiable by pugx/shortid-doctrine[v0.4.0] but these conflict with your requirements or minimum-stability.

我正在使用 PHP 5.4

下面是我的 composer.json 的摘录:

{
    ...

    "autoload": {
        "psr-4": { "": "src/" }
    },
    "require": {
        "php": "^5.4",
        "symfony/symfony": "~2.7",
        "doctrine/orm": "~2.5",
        "doctrine/doctrine-bundle": "~1.4",
        "twig/extensions": "~1.0",
        "pugx/shortid-php": "1.*@dev",
        "pugx/shortid-doctrine": "1.*@dev",
        "pugx/shortid-doctrine-bundle": "1.*@dev",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/distribution-bundle": "~4.0",
        "sensio/generator-bundle": "~2.3",
        "jms/serializer": "0.16.0",
        "justinrainbow/json-schema": "^5.2"
    },
    "require-dev": {
        "beelab/test-bundle": "~1.0",
        "doctrine/doctrine-fixtures-bundle": "2.2.*",
        "incenteev/composer-parameter-handler": "~2.0",
        "phpunit/phpunit": "4.*",
        "fabpot/php-cs-fixer": "~1.5"
    },
    "config": {
        "bin-dir": "bin"
    },
    ...
}

如何解决这些错误?

【问题讨论】:

    标签: composer-php symfony-2.8 php-5.4


    【解决方案1】:

    错误信息说明了一切:pugx/shortid-php 1.0.x-dev requires php ^7.1

    您需要将项目升级到 PHP 7.1 或将依赖项替换为与 PHP 5.4 兼容的版本。

    【讨论】:

      猜你喜欢
      • 2018-03-04
      • 2015-01-24
      • 2017-09-20
      • 2017-06-28
      • 2014-09-18
      • 2019-02-07
      • 2017-09-18
      • 2018-09-11
      • 2017-03-06
      相关资源
      最近更新 更多