Home  >  Q&A  >  body text

GuzzleHttp cannot be installed on Laravel 5.8

I'm using Laravel 5.8 and I want to install the GuzzleHttp package.

First I tried running composer require guzzlehttp/guzzle but I got this error:

Problem 1
    - guzzlehttp/guzzle[7.4.0, ..., 7.4.x-dev] require guzzlehttp/promises ^1.5 -> found guzzlehttp/promises[dev-master, 1.5.0, 1.5.1, 1.5.x-dev (alias of dev-master)] but the package is fixed to 1.4.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires guzzlehttp/guzzle ^7.4 -> satisfiable by guzzlehttp/guzzle[7.4.0, ..., 7.4.x-dev].

Then I tried to install a downgraded version, so I ran the following command:

composer require "guzzlehttp/guzzle:~5.3"

But I get this error:

Problem 1
    - Root composer.json requires guzzlehttp/guzzle ~5.3, found guzzlehttp/guzzle[5.3.0, ..., 5.3.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 2
    - anhskohbo/no-captcha is locked to version 3.3.0 and an update of this package was not requested.
    - anhskohbo/no-captcha 3.3.0 requires guzzlehttp/guzzle ^6.2|^7.0 -> found guzzlehttp/guzzle[dev-master, 6.2.0, ..., 6.5.x-dev, 7.0.0-beta. 1, ..., 7.4.x-dev (alias of dev-master)] but it conflicts with your root composer.json require (~5.3).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

So what’s the problem here? How to properly install Laravel 5.8 version of GuzzleHttp?

P粉458725040P粉458725040237 days ago386

reply all(1)I'll reply

  • P粉496886646

    P粉4968866462024-03-20 12:59:06

    Try adding the -w flag to the command:

    Composer requires guzzlehttp/guzzle -w

    One of your other dependencies requires guzzlehttp/promises, which is currently locked at 1.4.1 in your composer.lock

    The

    -w flag tells Composer that dependencies can be updated when new dependencies are installed.

    If this doesn't work then you can try using the -W flag.

    reply
    0
  • Cancelreply