简体   繁体   English

无法通过Composer安装Google客户端库

[英]Google client library through Composer not installing

I'm trying to install Google client library with composer using: 我正在尝试使用Composer安装Google客户端库:

composer require google/apiclient:^2.0.0@RC

and I get this 我明白了

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

      Problem 1
        - Conclusion: don't install google/apiclient 2.x-dev
        - Conclusion: don't install google/apiclient v2.0.0-RC6
        - 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 guzzlehttp/guzzle == 4.2.3.0 -> satisfiable by guzzlehttp/guzzle[4.2.3].
        - google/apiclient v2.0.0-RC1 requires guzzlehttp/guzzle 5.2.* -> satisfiable by guzzlehttp/guzzle[5.2.0].
        - google/apiclient v2.0.0-RC2 requires guzzlehttp/guzzle 5.2.* -> satisfiable by guzzlehttp/guzzle[5.2.0].
        - google/apiclient v2.0.0-RC3 requires guzzlehttp/guzzle 5.2.* -> satisfiable by guzzlehttp/guzzle[5.2.0].
        - Conclusion: don't install guzzlehttp/guzzle 5.2.0
        - Installation request for google/apiclient ~2.0@dev -> satisfiable by google/apiclient[2.x-dev, v2.0.0-RC1, v2.0.0-RC2, v2.0.0-RC3, v2.0.0-RC4, v2.0.0-RC5, v2.0.0-RC6].

Give this a try: 试试看:

  • composer require google/apiclient:2.0.0-RC6

    • fetching version by tag name 2.0.0-RC6 通过标签名称2.0.0-RC6获取版本
  • composer require google/apiclient:2.0.*@dev

    • version from 2.0.* range with dev stability 2.0.*2.0.*版本具有dev稳定性

Example run for composer require google/apiclient:2.0.*@dev : composer require google/apiclient:2.0.*@dev运行的示例composer require google/apiclient:2.0.*@dev

./composer.json has been created
Warning: You should avoid overwriting already defined auth settings for github.com.
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing psr/http-message (1.0)
    Loading from cache

  - Installing guzzlehttp/psr7 (1.2.3)
    Loading from cache

  - Installing guzzlehttp/promises (1.1.0)
    Loading from cache

  - Installing guzzlehttp/guzzle (6.1.1)
    Loading from cache

  - Installing phpseclib/phpseclib (2.0.1)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing monolog/monolog (1.18.0)
    Loading from cache

  - Installing firebase/php-jwt (v3.0.0)
    Loading from cache

  - Installing google/auth (v0.7)
    Loading from cache

  - Installing google/apiclient (v2.0.0-RC6)
    Loading from cache

phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
Writing lock file
Generating autoload files

I just had a similar issue with another Google package when running composer update : 运行composer update时,我在另一个Google软件包中遇到了类似的问题:

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

  Problem 1
    - googleads/googleads-php-lib dev-experimental requires google/auth 0.7 -> satisfiable by google/auth[v0.7].
    - googleads/googleads-php-lib dev-experimental requires google/auth 0.7 -> satisfiable by google/auth[v0.7].
    - Conclusion: don't install google/auth v0.7
    - Installation request for googleads/googleads-php-lib dev-experimental -> satisfiable by googleads/googleads-php-lib[dev-experimental].

I had no conflicting packages. 我没有冲突的软件包。 The solution was to: 解决方案是:

  • Temporarily remove the googleads/googleads-php-lib line from composer.json 暂时从composer.json中删除googleads/googleads-php-lib
  • Run composer update 运行composer update
  • Reintroduce the line in composer.json 重新引入composer.json中的行
  • Run composer update again 再次运行composer update

This worked for me. 这对我有用。

I once had this same problem while developing an application that needed Google Library. 在开发需要Google Library的应用程序时,我曾经遇到过同样的问题。 There is a package you have installed that required another version of the Google Library dependency package, in my case it was firebase/php-jwt (v4.0.0) whereas the Google Library required v3.0.0 . 您安装的软件包需要另一个版本的Google Library依赖软件包,在我的情况下,该软件包是firebase/php-jwt (v4.0.0)而Google Library需要v3.0.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM