Now, I am using google/cloud-firestore ^0.8.1 and I want to update this library to latest version (0.14.0).
My composer.json now looks like:
"require": {
"grpc/grpc": "^1.10",
"google/protobuf": "^3.5",
"google/gax": "^0.31.3",
"google/cloud-firestore": "^0.8.1",
"firebase/php-jwt": "^5.0",
}
When I try to update firestore library with php composer.phar require google/cloud-firestore
, I got:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for google/cloud-firestore ^0.14.0 -> satisfiable by google/cloud-firestore[v0.14.0].
- google/cloud-firestore v0.14.0 requires google/gax ^0.37 -> satisfiable by google/gax[0.37.0] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
After that, I tried with php composer.phar require google/gax and got:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- google/cloud-firestore v0.8.1 requires google/gax ^0.31.1 -> satisfiable by google/gax[0.31.x-dev].
- google/cloud-firestore v0.8.1 requires google/gax ^0.31.1 -> satisfiable by google/gax[0.31.x-dev].
- google/cloud-firestore v0.8.1 requires google/gax ^0.31.1 -> satisfiable by google/gax[0.31.x-dev].
- Can only install one of: google/gax[0.37.0, 0.31.x-dev].
- Installation request for google/gax ^0.37 -> satisfiable by google/gax[0.37.0].
- Installation request for google/cloud-firestore ^0.8.1 -> satisfiable by google/cloud-firestore[v0.8.1].
Installation failed, reverting ./composer.json to its original content.
I added "minimum-stability": "dev" to composer.json but that didn't resolve problem.
How to properly update these libraries and fix dependencies between them?
The semantic versioning operator (^) behaves slightly different with pre-1.0 releases (see https://getcomposer.org/doc/articles/versions.md#caret-version-range-):
For pre-1.0 versions it also acts with safety in mind and treats ^0.3 as ?>=0.3.0 <0.4.0.
This means that you will have to update both packages like this:
composer require google/cloud-firestore:^0.14 google/gax:^0.37
With #xabbuh help, I find out solution.
There wasn't problem just in semantic versioning operator (^) but in packages I wanted to update.
I needed to install/update all packages that are needed for updating firestore on version 0.14. I called composer require google/cloud-firestore:^0.14 and after that composer require google/gax:^0.37 and after that tried with reverse order, but there were similar error messages.
When I included all packages needed into require command for updating firestore package it passed well.
So, here are working command:
composer require google/cloud-firestore:^0.14 google/gax:^0.37 google/auth:^1.3 google/grpc-gcp:^0.1.0 grpc/grpc:^1.13.0 google/cloud-core:^1.23
Related
I have a problem for a symfony app when I try to install dependencies with composer :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/framework-bundle[v6.0.0, ..., v6.0.12] require composer-runtime-api >=2.1 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
- Root composer.json requires symfony/framework-bundle 6.0.* -> satisfiable by symfony/framework-bundle[v6.0.0, ..., v6.0.12].
Composer version I have on cpanel : 2.0.8
I didn't upgrade composer to the last version.
symfony/framework-bundle[v6.0.0, ..., v6.0.12] require composer-runtime-api >=2.1 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
That line basically tells you that Symfony in v6 requires any Composer version equal or above 2.1, and you are currently using Composer v2.0. Please update Composer itself, for example by using composer self-update
we have circle build that runs composer install -n --ignore-platform-reqs --no-dev but this is not ignoring the platform requirements anymore.
This is what i see in the circle log. The --ignore-platform-reqs is clearly not working. Any ideas why please?
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for drupal/core 8.6.13 -> satisfiable by drupal/core[8.6.13].
- drupal/core 8.6.13 requires ext-pdo * -> the requested PHP extension pdo is missing from your system.
Problem 2
- typo3/phar-stream-wrapper v2.1.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- typo3/phar-stream-wrapper v2.1.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- Installation request for typo3/phar-stream-wrapper v2.1.0 -> satisfiable by typo3/phar-stream-wrapper[v2.1.0].
Instead of using --ignore-platform-reqs or provide hack it is better to mimic your environment using platform setting - it gives you more control about platform requirements and it is more intuitive than provide (your package does not really provide ext-fileinfo):
"config": {
"platform": {
"php": "7.2.14",
"ext-fileinfo": "1.0.5",
"ext-pdo": "7.2.14",
"ext-session": "7.2.14",
"ext-iconv": "7.2.14",
"ext-zip": "1.15.4"
}
},
Actual versions of extensions you may find by calling this command on production environment (although you could probably put anything for extensions version - it is quite uncommon to use anything except * as a constraint for PHP extensions):
composer show -p
I am going to answer my own question just in case somebody stumbles here. Adding a provide with the list of extension in my composer.json file resolved the issue for me. This --ignore-platform-reqs had no effect.
"provide": {
"ext-fileinfo": "*",
"ext-pdo": "*",
"ext-session": "*",
"ext-iconv": "*",
"ext-zip": "*"
}
We are in the midst of trying to get all of our Drupal modules that were not installed using Composer to be managed within Composer.
Composer: 1.4.12
Drupal: 8.3.1
After clearing Composer's cache, we ran the following:
./composer require dompdf/dompdf;
This returns:
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
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
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- Can only install one of: phenx/php-svg-lib[v0.2, 0.1].
- dompdf/dompdf v0.8.0 requires phenx/php-svg-lib 0.2.* -> satisfiable by phenx/php-svg-lib[v0.2].
- Installation request for dompdf/dompdf ^0.8.0 -> satisfiable by dompdf/dompdf[v0.8.0].
- Installation request for phenx/php-svg-lib (locked at 0.1) -> satisfiable by phenx/php-svg-lib[0.1].
Installation failed, reverting ./composer.json to its original content.
It seems like the proper thing to do would be to not lock "phenx/php-svg-lib" to version 0.1, then upgrade dompdf, however when we modified dompdf's composer.json file to require phenx/php-svg-lib version 0.2.*, clearcache, then try require again, we get the same error as above, which still references the lock at 0.1. I've also confirmed that dompdf is the only vendor module that is using phenx/php-svg-lib.
Also, is there a reason why "Can only install one of" is listed three times?
Thank you in advance for any advice.
It appears like this problem happens when updating dompdf from version 0.7.0 to 0.8.0. For some reason, the update works perfectly fine with composer 1.2.x, but does result with the above error with version 1.4.x.
The fix that did the job for me was to remove
"dompdf/dompdf": "^0.7.0"
from the composer.json file and then run:
composer update
The result should be something like:
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 3 removals
- Removing dompdf/dompdf (v0.7.0)
- Removing phenx/php-font-lib (0.4)
- Removing phenx/php-svg-lib (0.1)
Writing lock file
Generating autoload files
Then require a new version:
composer require dompdf/dompdf
I'd like to add the 2 libraries FOSRestBundle & JMSSerializerBundle to my application built with symfony 2.7 but i encountred this response
Problem 1
- Installation request for friendsofsymfony/rest-bundle dev-master -> satisfiable by friendsofsymfony/rest-bundle[dev-master].
- friendsofsymfony/rest-bundle dev-master requires php ^5.5.9|~7.0 -> your PHP version (5.5.12) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
Problem 2
- Installation request for jms/serializer-bundle dev-master -> satisfiable by jms/serializer-bundle[dev-master].
- jms/serializer-bundle dev-master requires php >=5.4.0 -> your PHP version (5.5.12) overriden by "config.platform.php" version (5.3.9) does not satisfy that requirement.
Notice that PHP version is 5.5.12
I think the problem is the version of this 2 libraries. If yes, What are the versions of FOSRestBundle & JMSSerializerBundle ?
dev-master should never be used as version bound when requiring a package as dependency, except in some specific cases.
Go to https://packagist.org/ then search for the packages you are looking for and use their respective current stable version as version bound for your composer.json's requirement.
Also, in your composer.json, you have a config key containing a platform.php key with 5.3.9 as value. Remove or override this block according to your real PHP version. See Symfony2, composer, your PHP version (5.6.18) overriden by "config.platform.php" version (5.3.9) does not satisfy requirement.
Of course, if the last stable version of one of them isn't compatible with your environment (PHP >= 5.5.9 for friendsofsymfony/rest-bundle), you need to look for an older version supporting your environment (all is available on packagist, and surely on the official documentation of these packages).
I am using composer with Symfony 2.0.15 and migrating to latest Behat 2.4. This is in my composer.json:
"require-dev": {
"behat/behat": "2.4#stable",
"behat/mink-extension": "*",
"behat/symfony2-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-goutte-driver": "dev-master",
"behat/common-contexts": "*",
"kriswallsmith/buzz": ">=0.5.0"
}
I run: php composer.phar update --dev
And there is an error:
Your requirements could not be solved to an installable set of packages.
Problem 1
- Installation request for behat/mink-goutte-driver dev-master -> satisfiable by behat/mink-goutte-driver dev-master.
- don't install fabpot/goutte 1.0.x-dev|install fabpot/goutte dev-master
- behat/mink-goutte-driver dev-master requires fabpot/goutte 1.0.* -> satisfiable by fabpot/goutte 1.0.x-dev.
- Conclusion: remove symfony/symfony v2.0.15
- fabpot/goutte dev-master requires symfony/dom-crawler 2.1.* -> satisfiable by symfony/symfony 2.1.x-dev, symfony/dom-crawler v2.1.0-BETA1, symfony/dom-crawler 2.1.x-dev, symfony/symfony v2.1.0-BETA1.
- Can only install one of: symfony/symfony v2.0.15, symfony/symfony 2.1.x-dev.
- Can only install one of: symfony/symfony v2.1.0-BETA1, symfony/symfony v2.0.15.
- don't install symfony/symfony v2.0.15|don't install symfony/dom-crawler v2.1.0-BETA1
- don't install symfony/dom-crawler 2.1.x-dev|don't install symfony/symfony v2.0.15
- Installation request for symfony/symfony == 2.0.15.0 -> satisfiable by symfony/symfony v2.0.15.
If I understand the error correctly, it is because fabpot/goutte package is dependent on Symfony 2.1 packages and not available for Symfony 2.0. Correct me, if I am wrong.
Here is my behat.yml:
default:
formatter:
parameters:
paths: false
context:
class: 'Site\PublicBundle\Features\Context\FeatureContext'
parameters:
base_url: 'http://test-anton.site.com'
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
bundle: 'PublicBundle'
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
default_session: symfony2
base_url: 'http://test-anton.site.com'
And this is sample of my failing scenario:
Scenario: User can view homepage
When I go to "/"
Then the response code should be 200
"When I go to" - is a MinkContext step, but "Then the response code should be 200" - is a step from Behat\CommonContexts\WebApiContext. When I use only steps from MinkContext - "Then the response status code should be 200" it works just fine.
The final answer is that Behat\CommonContexts\WebApiContext is not compatible with Behat 2.4.
Might be a stupid question but do you use goutte? I went through a similar update recently and mink-browserkit-driver was all I needed.
I'm not sure why goutte has a dependency on 2.1 and it might be risky to use it with 2.0. If you really need it try defining a custom repository for goutte in your composer.json (and lie about requirements on Symfony).
Update
Notice that error message says "Call to a member function getUri()". It relates to getCurrentUri():
public function getCurrentUrl()
{
return $this->client->getRequest()->getUri();
}
It means that client is there but getRequest() returns null. That suggests request was not made yet.
Did you make a request before accessing its URL?
Installing Goutte won't solve your issue (you don't need it at all).