I want to use Google API client library for PHP in my extension to upload YouTube video. I ran following composer command to add this library.

composer require google/apiclient:~2.0

But I got following error...

enter image description here


The key is the last line. The package requires monolog in at least version 1.17, but it is currently locked at 1.16, because Magento installed it too.

You should be able to process in two steps:

  1. require the package but do not install immediately:

    composer require --no-update google/apiclient:~2.0
  2. update it together with monolog:

    composer update google/apiclient monolog/monolog
  • I tried it but it is not working. – Kishan Patadia May 5 '17 at 12:37
  • I see that in Magento 2.0 and 2.1 monolog was required exactly in version 1.16, so it would be incompatible with google/apiclient. It has changed here: github.com/magento/magento2/commit/… but you will have to wait for the 2.2 release, or try to edit your project's composer.json to change the monolog version requirement – Fabian Schmengler May 5 '17 at 12:50
  • Which composer.json ? Can you give me file location ? – Kishan Patadia May 5 '17 at 12:54
  • /var/www/html/Magento216/composer.json – Fabian Schmengler May 5 '17 at 12:55
  • Alternatively run composer require monolog/monolog:^1.17 – Fabian Schmengler May 5 '17 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.