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.
Related
I wanted to try to create a simple chatbot web-app using Laravel Botman.
I've created a new Laravel project but when I try to install Botman through the terminal. I get this error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install botman/botman 2.6.1 (conflict analysis result)
- symfony/mailer v6.0.7 requires symfony/service-contracts ^1.1|^2|^3 -> satisfiable by symfony/service-contracts[v3.0.1].
- laravel/framework v9.7.0 requires symfony/mailer ^6.0 -> satisfiable by symfony/mailer[v6.0.7].
- Root composer.json requires botman/botman ^2.6 -> satisfiable by botman/botman[2.6.0, 2.6.1].
- Conclusion: don't install psr/container 2.0.2 (conflict analysis result)
- Conclusion: don't install psr/container 1.1.2 (conflict analysis result)
- laravel/framework is locked to version v9.7.0 and an update of this package was not requested.
- Conclusion: don't install psr/container 2.0.1 (conflict analysis result)
- botman/botman 2.6.0 requires psr/container ^1.0 -> satisfiable by psr/container[1.0.0, ..., 1.x-dev].
- You can only install one version of a package, so only one of these can be installed: psr/container[dev-master, 1.0.0, ..., 1.x-dev, 2.0.0, 2.0.1, 2.0.2].
- psr/container 2.0.x-dev is an alias of psr/container dev-master and thus requires it to be installed too.
- symfony/service-contracts v3.0.1 requires psr/container ^2.0 -> satisfiable by psr/container[2.0.0, 2.0.1, 2.0.2, 2.0.x-dev (alias of dev-master)].
- Conclusion: don't install psr/container[2.0.0] | install one of psr/container[2.0.1, 2.0.2] (conflict analysis result)
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I've tried deleting the composer.lock file and installing it again.
I tried using composer require botman/botman --with-all-dependencies but it still didn't work. Can anyone help me out?
Thank you.
Try adding to composer.json in the section requires "psr/container": "2.0.2 as 1.1.2","symfony/http-foundation": "6.0.3 as 5.4.3" and after that in the terminal 'composer requires botman/botman --with-all-dependencies
try composer require botman/botman composer require mpociot/botman package is abandoned
I have created a new project with
laravel new blogposts
using "Laravel Installer 2.0.1" globally installed on my ubuntu 18.
When i trying to install passport using
composer require laravel/passport
following errors are their
Using version ^6.0 for laravel/passport
./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
- Conclusion: don't install laravel/passport v6.0.6
- Conclusion: don't install laravel/passport v6.0.5
- Conclusion: don't install laravel/passport v6.0.4
- Conclusion: don't install laravel/passport v6.0.3
- Conclusion: don't install laravel/passport v6.0.2
- Conclusion: don't install laravel/passport v6.0.1
- Conclusion: don't install laravel/passport v6.0.0
- Conclusion: don't install laravel/passport 6.0.x-dev
- Conclusion: remove paragonie/random_compat v9.99.99
- Installation request for laravel/passport ^6.0 -> satisfiable by laravel/passport[6.0.x-dev, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.0.5, v6.0.6].
- Conclusion: don't install paragonie/random_compat v9.99.99
- laravel/passport 6.0.x-dev requires league/oauth2-server ^7.0 -> satisfiable by league/oauth2-server[7.0.0, 7.1.0, 7.1.1, 7.2.0].
- league/oauth2-server 7.1.0 requires defuse/php-encryption ^2.1 -> satisfiable by defuse/php-encryption[v2.1.0, v2.2.0].
- league/oauth2-server 7.1.1 requires defuse/php-encryption ^2.1 -> satisfiable by defuse/php-encryption[v2.1.0, v2.2.0].
- league/oauth2-server 7.2.0 requires defuse/php-encryption ^2.1 -> satisfiable by defuse/php-encryption[v2.1.0, v2.2.0].
- league/oauth2-server 7.0.0 requires paragonie/random_compat ^2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- defuse/php-encryption v2.1.0 requires paragonie/random_compat ~2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- defuse/php-encryption v2.2.0 requires paragonie/random_compat ~2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- Can only install one of: paragonie/random_compat[v2.0.0, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.1, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.10, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.11, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.12, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.13, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.14, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.15, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.16, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.17, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.2, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.3, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.4, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.5, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.6, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.7, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.8, v9.99.99].
- Can only install one of: paragonie/random_compat[v2.0.9, v9.99.99].
- Installation request for paragonie/random_compat (locked at v9.99.99) -> satisfiable by paragonie/random_compat[v9.99.99].
Installation failed, reverting ./composer.json to its original content.
Any help will be appreciated. Thanks.
This link may help you https://github.com/laravel/passport/issues/774
They said, it fixed their issue
composer require paragonie/random_compat:2.*
composer require laravel/passport
Same issue with Laravel 5.5.40 or higher. So you need to specify the version of the passport like this;
composer require paragonie/random_compat:2.*
composer require laravel/passport=~4.0
Try this! It worked for me
composer require paragonie/random_compat:2.*
composer require laravel/passport=~4.0
Go to your composer.json file, remove the version
You need to set it to:
{
"require": {
"rackspace/php-opencloud": "dev-master"
}
}
Go to your composer.json file
And set below :
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.5.*",
"laravel/passport": "~4.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
},
And then run composer update command.
I am unable to comment since I do not have 50 Rep but I would like to add onto rkj's solution. Those commands do work but in my case I was running laravel through homestead and you cannot fetch those packages while sshing into homestead you must use your global composer to fetch the packages. This is a windows 10 machine also to clarify.
simply install any lower version of passport, Run the command:
composer require laravel/passport "5.*"
I'm trying to use PHPDoc in my Laravel project, but I'm having a bit of trouble getting it with composer.
I run composer require phpdocumentor/phpdocumentor and receive the following:
Problem 1
- Installation request for phpdocumentor/phpdocumentor ^2.9 -> satisfiable by phpdocumentor/phpdocumentor[v2.9.0].
- Conclusion: remove nikic/php-parser v3.1.1
- Conclusion: don't install nikic/php-parser v3.1.1
- phpdocumentor/phpdocumentor v2.9.0 requires phpdocumentor/reflection ^3.0 -> satisfiable by phpdocumentor/reflection[3.0.0, 3.0.1].
- phpdocumentor/reflection 3.0.0 requires nikic/php-parser ^1.0 -> satisfiable by nikic/php-parser[v1.0.0, v1.0.1, v1.0.2, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0, v1.4.0, v1.4.1].
- phpdocumentor/reflection 3.0.1 requires nikic/php-parser ^1.0 -> satisfiable by nikic/php-parser[v1.0.0, v1.0.1, v1.0.2, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0, v1.4.0, v1.4.1].
- Can only install one of: nikic/php-parser[v1.3.0, v3.1.1].
- Can only install one of: nikic/php-parser[v1.4.0, v3.1.1].
- Can only install one of: nikic/php-parser[v1.4.1, v3.1.1].
- Can only install one of: nikic/php-parser[v1.0.0, v3.1.1].
- Can only install one of: nikic/php-parser[v1.0.1, v3.1.1].
- Can only install one of: nikic/php-parser[v1.0.2, v3.1.1].
- Can only install one of: nikic/php-parser[v1.1.0, v3.1.1].
- Can only install one of: nikic/php-parser[v1.2.0, v3.1.1].
- Can only install one of: nikic/php-parser[v1.2.1, v3.1.1].
- Can only install one of: nikic/php-parser[v1.2.2, v3.1.1].
- Installation request for nikic/php-parser (locked at v3.1.1) -> satisfiable by nikic/php-parser[v3.1.1].
Allegedly, running composer update phpdocumentor/phpdocumentor nikic/php-parser should bring nikic/php-parser down to the version required by phpdoc, but that does not work because phpdoc is not yet installed.
I went into my vendor/ dir, and found the composer.json where nikic/php-parser is required, commented it out, composer update'd composer install'd so that phpdocumentor could require it, but no such luck.
What do you advise? How do I get PHPDoc into my project? Sorry if I'm being a fool!
Thanks!
Not a fool 😁...
This output indicates that phpdocumentor/reflection specifically knows that it needs the older nikic/php-parser version, and cannot work with the newer version that is probably a minimum for laravel. Thus, composer protects you from yourself by saying no to the update 😉
I'd say the easiest workaround here would be to download the PHAR binary [1] and put it in ./vendor/bin. That way, it's in the same place as the executable that you'd normally have (./vendor/bin/phpdoc). If you're on a Unix variant, you can symlink the PHAR so that you can call it in the same way.
[1] -- http://phpdoc.org/phpDocumentor.phar
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 am trying to build a Silex application, with the following requirements
requirements
Yaml configuration
Doctrine ORM
Simple User Authorisation
my composer.json
{
"require": {
"silex/silex": "~1.2",
"symfony/yaml": "2.6.7",
"doctrine/dbal": "~2.2",
"deralex/yaml-config-service-provider": "1.0.x-dev",
"dflydev/doctrine-orm-service-provider": "2.0.*#dev",
"jasongrimes/silex-simpleuser": "~1.0"
}
}
When I run composer update, I get the following
output
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
- Conclusion: remove silex/silex v1.2.4
- Conclusion: don't install dflydev/doctrine-orm-service-provider 2.0.x-dev
- Conclusion: don't install dflydev/doctrine-orm-service-provider v2.0.0|remove pimple/pimple v1.1.1|install pimple/pimple v3.0.0
- Conclusion: don't install pimple/pimple v3.0.0
- Conclusion: don't install silex/silex v1.2.4
- Conclusion: don't install silex/silex v1.2.3
- Conclusion: don't install silex/silex v1.2.2
- Conclusion: don't install silex/silex v1.2.1
- Conclusion: don't install pimple/pimple v1.1.1
- Installation request for dflydev/doctrine-orm-service-provider 2.0.*#dev -> satisfiable by dflydev/doctrine-orm-service-provider[2.0.x-dev, v2.0.0].
- Installation request for silex/silex ~1.2 -> satisfiable by silex/silex[v1.2.0, v1.2.1, v1.2.2, v1.2.3, v1.2.4].
- silex/silex v1.2.0 requires pimple/pimple ~1.0 -> satisfiable by pimple/pimple[v1.1.1, 1.0.0, v1.0.1, v1.0.2, v1.1.0].
- Can only install one of: pimple/pimple[v2.1.0, 1.0.0].
- Can only install one of: pimple/pimple[v2.1.0, v1.0.1].
- Can only install one of: pimple/pimple[v2.1.0, v1.0.2].
- Can only install one of: pimple/pimple[v2.1.0, v1.1.0].
- dflydev/doctrine-orm-service-provider v2.0.0 requires pimple/pimple >=2.1,<4 -> satisfiable by pimple/pimple[v2.1.0, v2.1.1, v3.0.0].
- Conclusion: don't install pimple/pimple v2.1.1
I'm not too familiar with groking the intricasies of composer json file syntax.
How do I solve this?
Two of your dependencies require different versions of pimple package:
silex/silex v1.2.0 requires pimple/pimple ~1.0
dflydev/doctrine-orm-service-provider v2.0.0 requires pimple/pimple >=2.1
You can switch to latest silex or previous version of doctrine-orm-service-provider to resolve this.
Look at packagist.org to see available versions with their dependencies: silex, doctrine-orm-service-provider.