Composer 更新 - 您的要求无法解析为一组可安装的软件包

Posted

技术标签:

【中文标题】Composer 更新 - 您的要求无法解析为一组可安装的软件包【英文标题】:Composer Update - Your requirements could not be resolved to an installable set of packages 【发布时间】:2014-06-10 13:12:08 【问题描述】:

我在解决这个问题时遇到了一个可怕的问题。我有一个 php 项目,正在尝试使用 composer 来更新项目(代码是给我更新的,我不是原始开发人员)。我运行更新并得到这个:

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

  Problem 1
    - suncat/mobile-detect-bundle dev-master requires mobiledetect/mobiledetectl
ib 2.7.* -> no matching package found.
    - suncat/mobile-detect-bundle dev-master requires mobiledetect/mobiledetectl
ib 2.7.* -> no matching package found.
    - Installation request for suncat/mobile-detect-bundle dev-master -> satisfi
able by suncat/mobile-detect-bundle[dev-master].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.

我的 Composer.json 包含以下内容:


    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": 
        "psr-0":  "": "src/" 
    ,
    "require": 
        "aws/aws-sdk-php"                      : "2.4.*",
        "doctrine/orm"                         : ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle"             : "1.2.*",
        "doctrine/migrations"                  : "dev-master",
        "doctrine/doctrine-migrations-bundle"  : "dev-master",
        "facebook/php-sdk"                     : "dev-master",
        "incenteev/composer-parameter-handler" : "~2.0",
        "liip/imagine-bundle"                  : "dev-master",
        "mobiledetect/mobiledetectlib"         : "dev-master",
        "php"                                  : ">=5.3.3",
        "sensio/distribution-bundle"           : "2.3.*",
        "sensio/framework-extra-bundle"        : "2.3.*",
        "sensio/generator-bundle"              : "2.3.*",
        "suncat/mobile-detect-bundle"          : "dev-master",
        "symfony/assetic-bundle"               : "2.3.*",
        "symfony/monolog-bundle"               : "2.3.*",
        "symfony/swiftmailer-bundle"           : "2.3.*",
        "symfony/symfony"                      : "2.3.*",
        "twig/extensions"                      : "1.0.*"
    ,
    "scripts": 
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    ,
    "config": 
        "bin-dir": "bin"
    ,
    "minimum-stability": "stable",
    "extra": 
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": 
            "file": "app/config/parameters.yml",
            "env-map": 
              "database_host": "DBHOST",
              "database_port": "DBPORT",
              "database_name": "DBNAME",
              "database_user": "DBUSER",
              "database_password": "DBPASS"
            
        ,
        "branch-alias": 
            "dev-master": "2.3-dev"
        
    

【问题讨论】:

【参考方案1】:

我也遇到了同样的问题^^

来源:https://packagist.org/packages/suncat/mobile-detect-bundle

改变:

"mobiledetect/mobiledetectlib" : "dev-master",

收件人:

"mobiledetect/mobiledetectlib" : "2.7.*",

:)

【讨论】:

以上是关于Composer 更新 - 您的要求无法解析为一组可安装的软件包的主要内容,如果未能解决你的问题,请参考以下文章

Composer 更新:您的要求无法解决为一组可安装的软件包

错误:您的要求无法解析为一组可安装的软件包。拉拉维尔

Composer Laravel 安装错误:您的需求无法解析为一组可安装的软件包

composer requireIllumination/support 会给出一个错误,例如“您的需求无法解析为一组可安装的软件包”。

Laravel 中的 Composer 更新错误“需求无法解析为一组可安装的软件包”[重复]

您的要求无法解析为一组可安装的软件包Dingo / api未安装在laravel v5.5.24上