【问题标题】:install Google's ClientAPI in Laravel 5.x with Composer使用 Composer 在 Laravel 5.x 中安装 Google 的 ClientAPI
【发布时间】:2017-02-03 14:11:02
【问题描述】:

我一直在尝试安装 Google 的 ClientAPI,但它存在大量依赖问题。我在网上搜索过,没有任何运气。

我尝试自己安装有问题的依赖项,但他们遇到了同样的问题。这是我收到的消息:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - google/apiclient v2.0.0-RC3 requires guzzlehttp/guzzle 5.2.* -> satisfiable by guzzlehttp/guzzle[5.2.0] but these conflict with your requirements or minimum-stability.
    - google/apiclient v2.0.0-RC2 requires guzzlehttp/guzzle 5.2.* -> satisfiable by guzzlehttp/guzzle[5.2.0] but these conflict with your requirements or minimum-stability.
    - google/apiclient v2.0.0-RC1 requires guzzlehttp/guzzle 5.2.* -> satisfiable by guzzlehttp/guzzle[5.2.0] but these conflict with your requirements or minimum-stability.
    - Conclusion: don't install google/apiclient 2.x-dev
    - Conclusion: don't install google/apiclient v2.0.3
    - Installation request for phpseclib/phpseclib (locked at 0.3.10) -> satisfiable by phpseclib/phpseclib[0.3.10].
    - Conclusion: don't install google/apiclient v2.0.2
    - Conclusion: don't install google/apiclient v2.0.1
    - google/apiclient v2.0.0 requires google/auth 0.8 -> satisfiable by google/auth[v0.8].
    - google/apiclient v2.0.0-RC8 requires google/auth 0.8 -> satisfiable by google/auth[v0.8].
    - Conclusion: don't install google/auth v0.8
    - Installation request for guzzlehttp/psr7 (locked at 1.4.x-dev) -> satisfiable by guzzlehttp/psr7[1.4.x-dev].
    - google/apiclient v2.0.0-RC6 requires google/auth 0.7 -> satisfiable by google/auth[v0.7].
    - google/apiclient v2.0.0-RC7 requires google/auth 0.7 -> satisfiable by google/auth[v0.7].
    - Conclusion: don't install google/auth v0.7
    - google/apiclient v2.0.0-RC4 requires google/auth 0.5 -> satisfiable by google/auth[v0.5].
    - google/apiclient v2.0.0-RC5 requires google/auth 0.5 -> satisfiable by google/auth[v0.5].
    - Conclusion: don't install google/auth v0.5
    - Installation request for google/apiclient ^2.0 -> satisfiable by google/apiclient[2.x-dev, v2.0.0, v2.0.0-RC1, v2.0.0-RC2, v2.0.0-RC3, v2.0.0-RC4, v2.0.0-RC5, v2.0.0-RC6, v2.0.0-RC7, v2.0.0-RC8, v2.0.1, v2.0.2, v2.0.3].


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

此时我所能想到的就是在composer之外安装ClientAPI,但我不知道这是否是个好主意!

这是我的composer.json 文件(仅相关部分):

"minimum-stability": "dev",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "tymon/jwt-auth": "0.5.*",
    "barryvdh/laravel-cors": "^0.8.0",
    "laravel/socialite": "^2.0",
    "guzzlehttp/guzzle": "^6.1",
    "intervention/image": "^2.3",
    "kozz/laravel-guzzle-provider": "^6.0",
    "symfony/psr-http-message-bridge": "^0.2.0",
    "fairholm/elasticquent": "dev-feature/laravel-5",
    "graham-campbell/flysystem": "^3.3",
    "league/flysystem-sftp": "^1.0",
    "netshell/paypal": "dev-master",
    "facebook/php-sdk-v4": "~5.0"
},

【问题讨论】:

  • 尝试将guzzlehttp/guzzle切换到6.0版本。
  • 根据错误消息,您应该尝试(至少目前)将 guzzle 版本降级到 5.2.0 而不是 6.1
  • 无效:kozz/laravel-guzzle-provider 6.0 requires guzzlehttp/guzzle ~6.0 -> satisfiable by guzzlehttp/guzzle[6.2.x-dev].

标签: php laravel-5 composer-php google-api-client


【解决方案1】:

我在 GitHub google API PHP 客户端问题和讨论中找到了解决方案。这实际上也解决了我的问题。参考原始帖子,以便它也可以挽救某人的一天。

https://github.com/googleapis/google-api-php-client/issues/969

想法是直接将"google/apiclient": "^2.0" 添加到composer.json 并运行composer update。

【讨论】:

    【解决方案2】:

    phpseclib/phpseclib 的安装请求(锁定在 0.3.10)

    guzzlehttp/psr7 的安装请求(锁定在 1.4.x-dev)

    似乎某些软件包“锁定”在特定版本(根据您的composer.lock)。

    要查看它们被锁定的原因,请运行:

    composer why org/package -t
    

    您可以尝试通过以下方式更新这些依赖项:

    composer update --with-dependencies
    

    但是,如果这样做没有帮助,请考虑删除 composer.lock 并重新运行 composer install

    在空文件夹上尝试您的配置。

    要查看已安装的依赖树,请运行:

    composer show -t
    

    要查看给定包的要求,例如运行:

    composer show -a google/apiclient 2.0.3
    

    这可以给出一些错误的想法。要查看更详细的输出,请将-v 添加到您的命令中。

    如需进一步解决问题,请参阅:

    【讨论】:

      【解决方案3】:

      问题是您的旧包要求和新包要求之间存在冲突。

      这是作曲家最糟糕的部分或作曲家的缺点。

      您必须手动安装两个软件包都可以满足的软件包版本。相信我,这很难做到。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-10-09
        • 2015-07-24
        • 2023-04-01
        • 2014-07-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多