I've been trying to install Google's ClientAPI, but it's got tons of dependency issues. I've searched the web, with no luck whatsoever.
I tried to install the faulty dependencies myself, but they had the same issue. Here's the message I'm getting:
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.
At this point all I can think of is to install ClientAPI outside of composer, but I don't know if it's a good idea or not!
And here's my composer.json file (only the relevant parts):
"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"
},
The problem is there is conflict between your old package requirements and you new package requirements.
This is worst part of composer or disadvantage of composer.
you have to manually install a package version which is satisfiable with both package. And trust me it is very hard to do.
I found a solution on GitHub google API PHP client issues and discussion. That actually solve my problem as well. referring to the original post so that it might also save someone's day.
https://github.com/googleapis/google-api-php-client/issues/969
The idea is to simply add "google/apiclient": "^2.0" directly to composer.json and running composer update.
Installation request for phpseclib/phpseclib (locked at 0.3.10)
Installation request for guzzlehttp/psr7 (locked at 1.4.x-dev)
It seems that some packages are "locked at" specific versions (as per your composer.lock).
To see why they're locked, run:
composer why org/package -t
You may try to update these dependencies by:
composer update --with-dependencies
However, if that won't help, consider removing composer.lock and re-run composer install.
Try also your configuration on the empty folder.
To see the installed dependency tree, run:
composer show -t
To see the requirements for the given package, run for example:
composer show -a google/apiclient 2.0.3
This can give some idea what is wrong. To see more verbose output, add -v to your command.
For further troubleshooting the issue, see:
How to resolve a "Can only install one of:" conflict?
How to explain Composer's error log?
Related
I tried updating brianium/paratest from ^6.6 to the latest version of ^7.0 and now, when I try to run composer install, I get this message:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires vimeo/psalm ^4.29 -> satisfiable by vimeo/psalm[4.29.0, 4.30.0].
- brianium/paratest[v7.0.0, ..., v7.0.1] require phpunit/phpunit ^10.0.3 -> satisfiable by phpunit/phpunit[10.0.3, 10.0.4].
- phpunit/phpunit[10.0.3, ..., 10.0.4] require sebastian/diff ^5.0 -> satisfiable by sebastian/diff[5.0.0].
- Conclusion: don't install sebastian/diff 5.0.0 (conflict analysis result)
- Root composer.json requires brianium/paratest ^7.0 -> satisfiable by brianium/paratest[v7.0.0, v7.0.1].
Error: Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires vimeo/psalm ^4.29 -> satisfiable by vimeo/psalm[4.29.0, 4.30.0].
- brianium/paratest[v7.0.0, ..., v7.0.1] require phpunit/phpunit ^10.0.3 -> satisfiable by phpunit/phpunit[10.0.3, 10.0.4].
- phpunit/phpunit[10.0.3, ..., 10.0.4] require sebastian/diff ^5.0 -> satisfiable by sebastian/diff[5.0.0].
- Conclusion: don't install sebastian/diff 5.0.0 (conflict analysis result)
- Root composer.json requires brianium/paratest ^7.0 -> satisfiable by brianium/paratest[v7.0.0, v7.0.1].
Error: Process completed with exit code 2.
Here's my composer.json:
"require": {
"php": ">=8.1"
},
"require-dev": {
"ext-xml": "*",
"brianium/paratest": "^7.0",
"friendsofphp/php-cs-fixer": "^3.12",
"php-parallel-lint/php-parallel-lint": "^1.3",
"squizlabs/php_codesniffer": "^3.7",
"vimeo/psalm": "^4.29"
},
I'm not requiring sebastian/diff myself so I can't remove it as a requirement. Per the output I guess phpunit/phpunit is but if it were the only thing requiring sebastian/diff then I don't see how there'd be a conflict. So it seems like something else must be requiring sebastian/diff, albeit a different version, but I have no idea what.
I suppose I could look at each my deps and consider upgrading each one of them, as well, but idk... that could be a huuuge PITA if I had a lot of deps. Is there no better way to figure out what's going on?
I did do that for my specific composer.json and it looks like PHP-CS-Fixer/PHP-CS-Fixer (even the latest version of v3.14.3) requires ^4.0 whereas phpunit/phpunit 10.x requires ^5.0 so I guess that's the issue but I feel like I shouldn't need to have to look at each individual repo's composer.json to figure that out.
Just have a look at the requirements of vimeo/psalm. v4 requires sebastian/diff in v3 or v4, as you can see on https://packagist.org/packages/vimeo/psalm#4.29.0, and this is obviously incompatible with PHPUnit v10, as this requires sebastian/diff in v5.
You could check if your application supports running Psalm v5. And if not, this is a great example for why you should not install tools like Psalm using Composer
Also, next time you run such an update, composer why-not could help. In your example, composer why-not brianium/paratest 7.0.1 could have pointed out the incompatible package
when i run
composer require --dev phpunit/phpunit
i get the following message:
composer require --dev phpunit/phpunit
Using version ^6.2 for phpunit/phpunit
./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 sebastian/object-enumerator (locked at 2.0.1) -> satisfiable by sebastian/object-enumerator[2.0.1].
- phpunit/phpunit 6.2.0 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.1 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.2 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- phpunit/phpunit 6.2.3 requires sebastian/object-enumerator ^3.0.2 -> satisfiable by sebastian/object-enumerator[3.0.2].
- Conclusion: don't install sebastian/object-enumerator 3.0.2
- Installation request for phpunit/phpunit ^6.2 -> satisfiable by phpunit/phpunit[6.2.0, 6.2.1, 6.2.2, 6.2.3].
Installation failed, reverting ./composer.json to its original content.
Here is my composer json file:
"require": {
"php": "^7.0",
"laravel/framework": "^5.4",
"guzzlehttp/guzzle": "^6.3",
"symfony/psr-http-message-bridge": "^1.0",
"mcamara/laravel-localization": "^1.2",
"laravelcollective/html": "^5.4",
"laravel/socialite": "^3.0",
"yajra/laravel-datatables-oracle": "^7.9"
},
"require-dev": {
"fzaninotto/faker": "^1.6",
"symfony/css-selector": "^3.3",
"symfony/dom-crawler": "^3.3"
}
I tried to get from version 5.4 above and always get a similar error but with other dependecies, the only version that seems to work is 5.0
Run
$ composer require --dev phpunit/phpunit --update-with-dependencies
See https://getcomposer.org/doc/03-cli.md#require:
--update-with-dependencies: Also update dependencies of the newly required packages.
Note Deleting composer.lock in circumstances like this isn't really the best idea, as it might pull in dependencies that break your code in other places. You really only want to update a specific dependency at a time, rather than update all of them at once.
If you run a composer update with the composer.lock file and the vendor folder present, Composer will take the installed versions into accounts before updating.
Make sure you have the lock file committed into your project repository, to be able to restore the current version. Then try another update, but before that delete the lock file and vendor folder.
My experience is that such an update will not be affected by already installed versions which may prevent the necessary updates.
Another option for debugging the dependencies is to use composer why-not phpunit/phpunit 6.2.0 (use an explicit version you know exists - without version the output of the command is not meaningful). Composer will give you a list of dependencies that prevent the update, for you to investigate further.
Trying to deploy marketplacephp (marketplacephp.com) to localhost.
Composer install is giving me dependencies issues and I've spent hours trying to tweak them so they work to no avail.
Is anyone more experienced able to spot how to fix this please?
P.S. Tried on both windows and ubuntu 14.04 with same results.
composer.json
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.3.*",
"doctrine/mongodb-odm": "1.0.0-BETA11",
"elasticsearch/elasticsearch": "1.3.0",
"lusitanian/oauth": "~0.3",
"geoip2/geoip2": "~2.0",
"balanced/balanced": "1.*",
"studio-42/elfinder": "2.*#dev",
"reliv/elfinder" : "2.0.0-alpha",
"stripe/stripe-php": "2.*"
},
"require-dev": {
"zendframework/zend-developer-tools": "dev-master",
"zendframework/zftool": "dev-master",
"phpmd/phpmd": "1.5.*"
}
output
C:\xampp\htdocs\marketplace-dev>composer install
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 reliv/elfinder 2.0.0-alpha -> satisfiable by reliv/elfinder[2.0.0-alpha].
- Conclusion: don't install zendframework/zendframework 2.3.9
- Conclusion: don't install zendframework/zendframework 2.3.8
- Conclusion: don't install zendframework/zendframework 2.3.7
- Conclusion: don't install zendframework/zendframework 2.3.6
- Conclusion: don't install zendframework/zendframework 2.3.5
- Conclusion: don't install zendframework/zendframework 2.3.4
- Conclusion: don't install zendframework/zendframework 2.3.3
- Installation request for zendframework/zend-developer-tools dev-master -> satisfiable by zendframework/zend-developer-tools[dev-master].
- Conclusion: don't install zendframework/zendframework 2.3.2
- zendframework/zend-developer-tools dev-master requires zendframework/zend-debug ^2.5 || ^3.0 -> satisfiable by zendframework/zend-debug[2.5.0, 2.5.1].
- don't install zendframework/zend-debug 2.5.0|don't install zendframework/zendframework 2.3.0
- don't install zendframework/zend-debug 2.5.1|don't install zendframework/zendframework 2.3.0
- reliv/elfinder 2.0.0-alpha requires zendframework/zendframework 2.* -> satisfiable by zendframework/zendframework[2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9].
- Conclusion: don't install zendframework/zendframework 2.3.1
Change "zendframework/zend-developer-tools": "dev-master" to "zendframework/zend-developer-tools": "^1.0"
dev-master is only good for early development time but should not be used long term. In this case current master branch of developer tools have higher minimum requirements than your project supports.
I should note that this set of dependencies hints that software you are trying to install was not updated for around 3 years.
I try install https://github.com/google/google-api-php-client for my php project via composer.
composer.json:
{
"require": {
"Intervention/image": "~2.3.7",
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "^6.2"
}
}
I run this command:
composer require google/apiclient:^2.0
And result:
./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.
Also I installed php composer.phar require guzzlehttp/guzzle before...
I would try removing your project's requirement of guzzlehttp/guzzle and let your Google dependency tell composer what version it wants to pull in. Google's package (for some reason) has a version floor of 1.2 for guzzlehttp/psr7, and composer is complaining that it can't figure out how to satisfy this requirement.
Since your new dependency (the Google package) also requires guzzlehttp/guzzle, you don't need to specifically require it, so I would just remove it and try composer update again.
I am attempting to update a composer package for Laravel 5. The Laravel 4 composer.json schema includes this:
"require": {
"php": ">=5.3.3",
"illuminate/foundation": "4.*",
"illuminate/support": "4.*"
},
I am attempting to update it to something like this:
"require": {
"php": ">=5.3.3",
"illuminate/foundation": "4.*",
"illuminate/support": "5.*"
},
After running composer install, I got an error saying that illuminate/foundation could not be found, so I tried changing the minimum-stability to dev. Composer can find the package now, but I get this error:
Problem 1
- illuminate/exception dev-master requires illuminate/support 5.0.* -> satisfiable by illuminate/support[5.0.x-dev, v5.0.0, v5.0.4].
- Can only install one of: illuminate/support[dev-master, 5.0.x-dev].
- Can only install one of: illuminate/support[v5.0.0, dev-master].
- Can only install one of: illuminate/support[v5.0.4, dev-master].
- illuminate/foundation 4.0.x-dev requires illuminate/exception dev-master -> satisfiable by illuminate/exception[dev-master].
- illuminate/foundation 4.0.x-dev requires illuminate/support dev-master -> satisfiable by illuminate/support[dev-master].
- Installation request for illuminate/foundation 4.* -> satisfiable by illuminate/foundation[4.0.x-dev].
I need illuminate/support to be 5+ because of the changes in Laravel 5's service providers regarding config publishing. I need illuminate/foundation because the unit tests require it.
How can I structure these dependencies so composer can install them?
I have tried also setting illuminate/support to dev-master, and both illuminate packages to dev-master, both resolving to different errors. Is the only way to fix this to update upstream dependencies?
I have already gotten the updates to install and (seemingly) work correctly in a Laravel 5 installation. I may have worked around my issue by just making the entire laravel/framework a dependency, but I really don't think I want to leave that as the solution.
Additional outputs from running composer install
illuminate/support # dev-master and illuminate/foundation at 4.* :
Problem 1
- Installation request for illuminate/foundation 4.* -> satisfiable by illuminate/foundation[4.0.x-dev].
- illuminate/exception dev-master requires illuminate/support 5.0.* -> satisfiable by illuminate/support[5.0.x-dev].
- Can only install one of: illuminate/support[dev-master, 5.0.x-dev].
- illuminate/foundation 4.0.x-dev requires illuminate/exception dev-master -> satisfiable by illuminate/exception[dev-master].
- Installation request for illuminate/support dev-master -> satisfiable by illuminate/support[dev-master].
illuminate/support # dev-master and illuminate/foundation at dev-master :
Problem 1
- Installation request for illuminate/foundation dev-master -> satisfiable by illuminate/foundation[dev-master].
- illuminate/exception dev-master requires illuminate/support 5.0.* -> satisfiable by illuminate/support[5.0.x-dev].
- Can only install one of: illuminate/support[dev-master, 5.0.x-dev].
- illuminate/foundation dev-master requires illuminate/exception dev-master -> satisfiable by illuminate/exception[dev-master].
- Installation request for illuminate/support dev-master -> satisfiable by illuminate/support[dev-master].
Never ever use dev-master as version, just use 5.* (for both packages) and you're ready.