我尝试通过作曲家为我的php项目安装 https://github.com/google/google-api-php-client。
作曲家.json:
{
"require": {
"Intervention/image": "~2.3.7",
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "^6.2"
}
}
我运行以下命令:
composer require google/apiclient:^2.0
结果:
./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.
我也在之前安装了php composer.phar require guzzlehttp/guzzle
...
我会尝试删除您的项目对guzzlehttp/guzzle
的要求,并让您的Google依赖项告诉您的作曲家它想要提取的版本。 谷歌的软件包(出于某种原因)的版本底线为 1.2 用于guzzlehttp/psr7
,作曲家抱怨它无法弄清楚如何满足这一要求。
由于您的新依赖项(Google软件包)也需要guzzlehttp/guzzle
,因此您不需要特别要求它,因此我将删除它并再次尝试composer update
。