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

Posted

技术标签:

【中文标题】Composer 更新:您的要求无法解决为一组可安装的软件包【英文标题】:Composer update :Your requirements could not be resolved to an installable set of packages 【发布时间】:2017-10-31 11:04:04 【问题描述】:

我正在将项目从 laravel 5.3 升级到 laravel 5.4,并浏览了所有可用的在线文档。一切正常,但是当我进行作曲家更新时,我收到以下错误消息。 [错误信息]

使用包信息加载作曲家存储库更新 依赖项(包括require-dev)

您的要求无法解决为一组可安装的 包。

问题 1

- Conclusion: don't install laravel/framework v5.4.24
- Conclusion: don't install laravel/framework v5.4.23
- Conclusion: don't install laravel/framework v5.4.22
- Conclusion: don't install laravel/framework v5.4.21
- Conclusion: don't install laravel/framework v5.4.20
- Conclusion: don't install laravel/framework v5.4.19
- Conclusion: don't install laravel/framework v5.4.18
- Conclusion: don't install laravel/framework v5.4.17
- Conclusion: don't install laravel/framework v5.4.16
- Conclusion: don't install laravel/framework v5.4.15
- Conclusion: don't install laravel/framework v5.4.14
- Conclusion: don't install laravel/framework v5.4.13
- Conclusion: don't install laravel/framework v5.4.12
- Conclusion: don't install laravel/framework v5.4.11
- Conclusion: don't install laravel/framework v5.4.10
- Conclusion: don't install laravel/framework v5.4.9
- Conclusion: don't install laravel/framework v5.4.8
- Conclusion: don't install laravel/framework v5.4.7
- Conclusion: don't install laravel/framework v5.4.6
- Conclusion: don't install laravel/framework v5.4.5
- Conclusion: don't install laravel/framework v5.4.4
- Conclusion: don't install laravel/framework v5.4.3
- Conclusion: don't install laravel/framework v5.4.2
- Conclusion: don't install laravel/framework v5.4.1
- Conclusion: don't install laravel/framework v5.4.0


- barryvdh/laravel-async-queue v0.4.2 requires illuminate/support 5.0.x|5.1.x|5.2.x|5.3.x -> satisfiable by illuminate/support[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev].
- barryvdh/laravel-async-queue v0.4.0 requires illuminate/support 5.0.x|5.1.x -> satisfiable by illuminate/support[5.0.x-dev, 5.1.x-dev].
- barryvdh/laravel-async-queue v0.4.1 requires illuminate/support 5.0.x|5.1.x|5.2.x -> satisfiable by illuminate/support[5.0.x-dev, 5.1.x-dev, 5.2.x-dev].
- barryvdh/laravel-async-queue v0.4.2 requires illuminate/support 5.0.x|5.1.x|5.2.x|5.3.x -> satisfiable by illuminate/support[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev].
- don't install illuminate/support 5.0.x-dev|don't install laravel/framework 5.4.x-dev
- don't install illuminate/support 5.1.x-dev|don't install laravel/framework 5.4.x-dev
- don't install illuminate/support 5.2.x-dev|don't install laravel/framework 5.4.x-dev
- don't install illuminate/support 5.3.x-dev|don't install laravel/framework 5.4.x-dev
- Installation request for laravel/framework 5.4.* >satisfiable by laravel/framework[5.4.x-dev, v5.4.0, v5.4.1, v5.4.10, v5.4.11,

v5.4.12、v5.4.13、v5.4.14、v5.4.15、v5.4.16、v5.4.17、v5.4.18、 v5.4.19、v5.4.2、v5.4.20、v5.4.21、v5.4.22、v5.4.23、v5.4.24、v5.4.3、v5.4.4、v5.4.5、v5.4.6、v5.4.7、v5。 4.8,v5.4.9]。

- Installation request for barryvdh/laravel-async-queue 0.4.x -> satisfiable by barryvdh/laravel-async-queue[v0.4.0, v0.4.1, v0.4.2].

composer.json 文件如下所示


"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"minimum-stability": "dev",
"prefer-stable": true,

"require": 
    "php": ">=5.6.4",
    "toin0u/geocoder-laravel": "@stable",
    "laravel/framework": "5.4.*",
    "illuminate/support": "5.4.x",
    "illuminate/console": "5.4.x",
    "symfony/process": "~3.2",
    "barryvdh/laravel-async-queue": "0.4.x",
    "laravelcollective/html": "5.4.x-dev"
,
"require-dev": 
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~5.7",
    "symfony/css-selector": "3.1.*",
    "symfony/dom-crawler": "3.1.*",
    "barryvdh/laravel-debugbar": "^2.1"
,
"autoload": 
    "classmap": [
        "database",
        "app/Models",
        "database/migrations",
        "database/seeds",
        "app/libraries"
    ],
"psr-4": 
        "App\\": "app/"
    
,

 "extra": 
    "branch-alias": 
        "dev-master": "0.6-dev"
    
,

"autoload-dev": 
    "classmap": [
        "tests/TestCase.php"
    ]
,
"scripts": 
    "post-root-package-install": [
        "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan optimize"
    ]
,
"config": 
    "preferred-install": "dist"
 

我在更新之前完成了 composer install 以便下载所有依赖项。 为了修复另一个错误,我对 composer.lock 文件

的要求做了一些小改动
"packages": [
    
        "name": "barryvdh/laravel-async-queue",
        "version": "v0.4.2",
        "source": 
            "type": "git",
            "url": "https://github.com/barryvdh/laravel-async-queue.git",
            "reference": "5b425bb2ce55f9ccfc0db4c52424936aed3641a9"
        ,
        "dist": 
            "type": "zip",
            "url": "https://api.github.com/repos/barryvdh/laravel-async-queue/zipball/5b425bb2ce55f9ccfc0db4c52424936aed3641a9",
            "reference": "5b425bb2ce55f9ccfc0db4c52424936aed3641a9",
            "shasum": ""
        ,

 "require": 
            "illuminate/console": "5.0.x|5.1.x|5.2.x|5.3.x|5.4.x",
            "illuminate/support": "5.0.x|5.1.x|5.2.x|5.3.x|5.4.x",
            "php": ">=5.4.0",
            "symfony/process": "~2.6|~3.0"
        ,

我无法删除上述错误,即无法解决您的要求。请帮助我,在此先感谢。

【问题讨论】:

你运行的是什么 PHP 版本?在命令行输入 php -v 如果它是 @RobFonseca 先生,我不这么认为,因为我使用的是 PHP 7.0.15 版本。这是 PHP 的最新版本。 嗨@sameer,您正在使用包barryvdh/laravel-async-queue,版本为0.4.x。我认为对于 Laravel 5.4 你必须使用这个包的0.6.x 版本。我认为这可能会对您有所帮助。 @LuckySaini 先生,我通过将版本更改为 0.5.0 和 0.6.x 进行了尝试,但没有任何效果。仍然收到相同的错误消息。 【参考方案1】:

它对我有用,

不要更改 composer.lock 文件。

第一个错误输出表明您正在尝试获取 barryvdh/laravel-async-queue0.4.x 版本它不适用于 Laravel 5.4。

如果一切都失败了,请备份您的 composer.lock 并重新运行 composer install。

【讨论】:

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

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

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

我得到“您的要求无法解决为一组可安装的软件包。”当我运行作曲家更新

您的要求无法解决为一组可安装的软件包。帮帮我

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

如何解决“您的需求无法解析为一组可安装的软件包”