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.
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
I am having a problem with composer when I run composer update.
The relevant bits of my composer.json file looks like this:
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"omnipay/common": "~2.0",
"omnipay/authorizenet": "~2.0",
"omnipay/firstdata": "~2.0",
"omnipay/stripe": "~2.0",
"omnipay/paypal": "~2.0"
},
"minimum-stability": "dev",
When I run composer update, I receive the following error:
[Composer\DependencyResolver\SolverProblemsException]
Problem 1
- The requested package omnipay/common could not be found in any version, there may be a typo in the package name.
Problem 2
- Installation request for omnipay/authorizenet ~2.0 -> satisfiable by omnipay/authorizenet[2.5.0].
- omnipay/authorizenet 2.5.0 requires omnipay/common ~2.2 -> no matching package found.
Problem 3
- Installation request for omnipay/firstdata ~2.0 -> satisfiable by omnipay/firstdata[v2.3.0].
- omnipay/firstdata v2.3.0 requires omnipay/common ~2.0 -> no matching package found.
Problem 4
- Installation request for omnipay/stripe ~2.0 -> satisfiable by omnipay/stripe[v2.4.3].
- omnipay/stripe v2.4.3 requires omnipay/common ~2.0 -> no matching package found.
Problem 5
- Installation request for omnipay/paypal ~2.0 -> satisfiable by omnipay/paypal[v2.6.3].
- omnipay/paypal v2.6.3 requires omnipay/common ~2.0 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
I'm at a loss as to what direction to take to fix this or why it occurred in the first place. I last ran composer update several months ago and it ran with no issue.
There's no need to specifically require omnipay/common or omnipay/omnipay (which is a dummy package anyway).
(1) remove all of the omnipay/* lines from your composer.json
(2) The composer commands you need to bring your composer.json into having the correct versions are:
composer require omnipay/authorizenet
composer require omnipay/firstdata
composer require omnipay/stripe
composer require omnipay/paypal
Try running this command, I think composer will update your dependencies.
composer require omnipay/omnipay
I suppose the problem is with the package name. You can add omnipay/omnipay in your composer.json file as the package name.
I hope You Read All The Error Once. Its All Package You Declare is not found or not getting or its required update So, Just Remove the All The omipay packge form the Coposer.json and also Remove from ServiceProvider in config/app.php
Example Remove This Code Form Composer.json
"omnipay/common": "~2.0",
"omnipay/authorizenet": "~2.0",
"omnipay/firstdata": "~2.0",
"omnipay/stripe": "~2.0",
"omnipay/paypal": "~2.0"
And Then Try To Update Your Composer and Then After Install New Version Package From Here
I Hope Its Work For Your !!
Or
Follow This :
And Install The Package Again From :
https://packagist.org/packages/omnipay/paypal
And
https://github.com/thephpleague/omnipay-paypal
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'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?
I have a composer file with a dev-dependency that requires PHP >= 5.4.0. When I update on production (a 5.3 install (yes - I know!)) and explicitly pass the --no-dev option, composer still checks for the PHP version requirements from the dev packages.
Composer file:
{
"config": {
"vendor-dir": "./vendor/"
},
"require": {
"symfony/config" : "dev-master",
"twig/twig": "1.15.1",
"leafo/lessphp": "v0.4.0",
"simplepie/simplepie": "dev-master",
"contao/idna": "dev-master",
"swiftmailer/swiftmailer": "5.3.*#dev",
"james-heinrich/getid3": "dev-master",
"pda/pheanstalk": "v2.1.0",
"monolog/monolog": "1.9.1",
"pimple/pimple": ">1.0.0",
"doctrine/orm": "2.4.*",
"ircmaxell/password-compat": "1.0.3",
"raven/raven": "dev-curl-async",
"elasticsearch/elasticsearch": "~1.0",
"guzzle/guzzle": "3.9.2"
},
"require-dev": {
"codeception/codeception": "2.1.*#dev"
}
}
Codeception has a requirement for PHP 5.4.0+ and when I run composer update --no-dev I get the following:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for codeception/codeception 2.1.*#dev -> satisfiable by codeception/codeception[2.1.x-dev].
- codeception/codeception 2.1.x-dev requires php >=5.4.0 -> no matching package found.
Should composer be skipping the requirements checks for packages I've explicitly told it not to install? I have tried passing --ignore-platform-reqs but without success.
UPDATE
It appears that running it on PHP 5.3.10 completely ignores the --no-dev option and reports that it is installaling them:
composer update --no-dev
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 codeception/codeception 2.1.*#dev -> satisfiable by codeception/codeception[2.1.x-dev].
- codeception/codeception 2.1.x-dev requires php >=5.4.0 -> no matching package found.
You need to use --no-dev to not install the dev packages.
Solved!!!
It appears my composer file was a bash script that wasn't passing the parameters to the composer.phar file correctly.
This problem was of my own creation.