1

I try install https://github.com/google/google-api-php-client for my php project via composer.

composer.json:

{
    "require": {
        "Intervention/image": "~2.3.7",
        "intervention/image": "^2.3",
        "guzzlehttp/guzzle": "^6.2" 
    }
}

I run this command:

composer require google/apiclient:^2.0

And result:

./composer.json has been updated
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
    - google/apiclient v2.0.0 requires google/auth 0.8 -> satisfiable by google/auth[v0.8].
    - Installation request for google/apiclient 2.0 -> satisfiable by google/apiclient[v2.0.0].
    - Conclusion: remove guzzlehttp/psr7 1.3.0
    - Conclusion: don't install guzzlehttp/psr7 1.3.0
    - google/auth v0.8 requires guzzlehttp/psr7 1.2.* -> satisfiable by guzzlehttp/psr7[1.2.0, 1.2.1, 1.2.2, 1.2.3].
    - Can only install one of: guzzlehttp/psr7[1.2.0, 1.3.0].
    - Can only install one of: guzzlehttp/psr7[1.2.1, 1.3.0].
    - Can only install one of: guzzlehttp/psr7[1.2.2, 1.3.0].
    - Can only install one of: guzzlehttp/psr7[1.2.3, 1.3.0].
    - Installation request for guzzlehttp/psr7 (locked at 1.3.0) -> satisfiable by guzzlehttp/psr7[1.3.0].


Installation failed, reverting ./composer.json to its original content.

Also I installed php composer.phar require guzzlehttp/guzzle before...

elize
  • 435
  • 1
  • 8
  • 19
  • Possible duplicate of [How to resolve a "Can only install one of:" conflict?](https://stackoverflow.com/questions/36611550/how-to-resolve-a-can-only-install-one-of-conflict) – kenorb Mar 25 '18 at 17:09

1 Answers1

1

I would try removing your project's requirement of guzzlehttp/guzzle and let your Google dependency tell composer what version it wants to pull in. Google's package (for some reason) has a version floor of 1.2 for guzzlehttp/psr7, and composer is complaining that it can't figure out how to satisfy this requirement.

Since your new dependency (the Google package) also requires guzzlehttp/guzzle, you don't need to specifically require it, so I would just remove it and try composer update again.

Jeff Lambert
  • 24,395
  • 4
  • 69
  • 96