在laravel 5.8应用程序中安装guzzle HTTP/guzzle时出错

在laravel 5.8应用程序中安装guzzle HTTP/guzzle时出错,laravel,Laravel,我需要安装guzzlehttp/guzzle以在Laravel5.8应用程序中使用stripe,但我得到了 安装时出错: $ composer require guzzlehttp/guzzle Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://

我需要安装guzzlehttp/guzzle以在Laravel5.8应用程序中使用stripe,但我得到了

安装时出错:

$ composer require guzzlehttp/guzzle
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Using version ^7.2 for guzzlehttp/guzzle
./composer.json has been updated
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for php-http/guzzle6-adapter (locked at v1.1.1, required as ^1.0) -> satisfiable by php-http/guzzle6-adapter[v1.1.1].
    - Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[7.3.x-dev, 6.5.x-dev].
    - Conclusion: install guzzlehttp/guzzle 6.5.x-dev
    - Installation request for guzzlehttp/guzzle ^7.2 -> satisfiable by guzzlehttp/guzzle[7.2.0, 7.3.x-dev].
My composer.json具有:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "clarification/sendgrid-laravel-driver": "^2.0",
        "darkaonline/l5-swagger": "5.8.*",
        "fideloper/proxy": "^4.0",
        "jenssegers/agent": "^2.6",
        "laravel/framework": "5.8.38",
        "laravel/tinker": "^1.0",
        "martinlindhe/laravel-vue-i18n-generator": "^0.1.46",
        "paragonie/sodium_compat": "^1.14",
        "php-http/guzzle6-adapter": "^1.0",
        "guzzlehttp/guzzle": "^5.x",
        "pusher/pusher-php-server": "^4.1.1",
        "stripe/stripe-php": "^7.50",
        "tintnaingwin/email-checker": "^2.0",
        "spatie/browsershot": "^3.37",
        "twilio/sdk": "^5.42"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^7.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "files": [
            "app/library/helper.php"
        ],
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}
我使用PHP7.4.15

怎么能修好呢


谢谢

您必须更新guzzlehttp/guzzle的版本,因为它是php版本所必需的

尝试将
“guzzlehttp/guzzle”:“^5.x”
更改为此
“guzzlehttp/guzzle”:“^7.2.0”
,然后运行
composer update
,您当前的php版本为^7.2


您可以在这里找到更多信息

您是否运行了
composer update
?是的,我成功运行了composer update(没有手动修改composer.json)。我必须先编辑composer.json吗?如果是,如何更改?将
“guzzlehttp/guzzle:”^5.x“,
更改为此
“guzzlehttp/guzzle:”^7.2.0“,
,然后运行
composer update
,您当前的php版本是
^7.2
,谢谢!,这有帮助