【问题标题】:I got error installing guzzlehttp/guzzle in in laravel 5.8 app我在 laravel 5.8 应用程序中安装 guzzlehttp/guzzle 时出错
【发布时间】:2021-03-23 19:50:26
【问题描述】:

我需要安装 guzzlehttp/guzzle 才能在 laravel 5.8 应用程序中使用条纹,但我得到了

安装出错:

$ 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].

我的 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"
        ]
    }
}

我使用 PHP 7.4.15。

如何解决?

谢谢!

【问题讨论】:

  • 你跑composer update了吗?
  • 是的,我成功运行了 composer update (无需手动修改 composer.json)。我首先要编辑 composer.json 吗?如果是,怎么做?
  • "guzzlehttp/guzzle": "^5.x",改成"guzzlehttp/guzzle": "^7.2.0",然后运行composer update,你当前的php版本是^7.2

标签: laravel


【解决方案1】:

你必须更新你的 guzzlehttp/guzzle 的版本,因为它是 php 版本所要求的

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

你可以在这里找到更多关于它的信息https://packagist.org/packages/guzzlehttp/guzzle#6.5.5

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-03
    • 1970-01-01
    • 2019-05-27
    • 2021-02-15
    • 2012-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多