GrahamCampbell / Laravel-GitHub

A GitHub API bridge for Laravel
https://gjcampbell.co.uk
MIT License
613 stars 120 forks source link

[HELP] Installation fails on laravel 7 with existing guzzle7 requirement #113

Closed ppshobi closed 4 years ago

ppshobi commented 4 years ago

When I run the install command from the repository readme I am getting the following

composer require graham-campbell/github:^9.3 php-http/guzzle6-adapter:^2.0 1/3: http://repo.packagist.org/p/provider-latest$455a95a2fc5f120dbe841f392a72116b074f9a14678c63f88d27c0ad5fe4a391.json 2/3: http://repo.packagist.org/p/provider-2020-04$72fecf7d712a06303f79b260a5535e5e7db7142551d393907c5b9e5b4adff50e.json 3/3: http://repo.packagist.org/p/provider-2020-07$4998b6e616286393474ddd955036046a14c58cda30bd34b581b8d2ea3f04c7c3.json Finished: success: 3, skipped: 0, failure: 0, total: 3 ./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

  • Installation request for php-http/guzzle6-adapter ^2.0 -> satisfiable by php-http/guzzle6-adapter[2.x-dev, v2.0.0, v2.0.1].
  • Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
  • Can only install one of: guzzlehttp/guzzle[7.0.1, 6.5.x-dev].
  • Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
  • Conclusion: install guzzlehttp/guzzle 6.5.x-dev
  • Installation request for guzzlehttp/guzzle (locked at 7.0.1, required as ^7.0) -> satisfiable by guzzlehttp/guzzle[7.0.1].

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

This is the error message I am receiving at the end with composer require graham-campbell/github -vvv flag passed.

Dependency resolution completed in 0.001 seconds Reading /Users/shobi/.composer/cache/repo/https---repo.packagist.org/provider-php-http$client-implementation.json from cache Your requirements could not be resolved to an installable set of packages.

Problem 1

  • graham-campbell/github 9.3.x-dev requires knplabs/github-api 2.15.* -> satisfiable by knplabs/github-api[v2.15.0].
  • graham-campbell/github v9.3.0 requires knplabs/github-api 2.15.* -> satisfiable by knplabs/github-api[v2.15.0].
  • graham-campbell/github v9.3.1 requires knplabs/github-api 2.15.* -> satisfiable by knplabs/github-api[v2.15.0].
  • knplabs/github-api v2.15.0 requires php-http/client-implementation ^1.0 -> no matching package found.
  • Installation request for graham-campbell/github ^9.3 -> satisfiable by graham-campbell/github[9.3.x-dev, v9.3.0, v9.3.1].

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

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

my composer.json require section

"require": {
        "php": "^7.4",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "graham-campbell/digitalocean": "^7.0",
        "guzzlehttp/guzzle": "^7.0",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^2.1",
        "livewire/livewire": "^1.3"
},

Any help on mitigating the issue will be greatly appreciated.

ppshobi commented 4 years ago

I guess the better option for now is to downgrade to guzzle6 and use the guzzle-6 adapter. I was able to do it actually

GrahamCampbell commented 4 years ago

Yes, this package doesn't currently support Guzzle 7. Version 10.0.0, when it is released, will support Guzzle 7, but it is not ready to even try yet (pending https://github.com/KnpLabs/php-github-api/pull/910).

GrahamCampbell commented 4 years ago

I guess the better option for now is to downgrade to guzzle6 and use the guzzle-6 adapter. I was able to do it actually

Yes. To explain what's going on here: There is not a Guzzle 7 PHP-HTTP adapter, and there never will be (because those interfaces where replaced by PSR-17 and PSR-18). The next major version of the upstream package will be using PSR-17/18 factories (due to https://github.com/KnpLabs/php-github-api/pull/885, https://github.com/KnpLabs/php-github-api/pull/888, https://github.com/KnpLabs/php-github-api/pull/910), and the 10.0 branch of this package is ready (https://github.com/GrahamCampbell/Laravel-GitHub/compare/9.3...10.0).

Once version 10.0.0 is tagged, you will be able to install it using the versions:

graham-campbell/github:^10.0 guzzlehttp/guzzle:^7.0 http-interop/http-factory-guzzle:^1.0

guzzlehttp/guzzle provides PSR-18 factories, and http-interop/http-factory-guzzle provides PSR-17 factories, both of them using guzzlehttp/psr7 for the PSR-7 implementation. In the future guzzlehttp/psr7will likely get the PSR-17 factories built-in to it, but for now, it doesn't have that, so you need that additional interop package.