Geocoder icon indicating copy to clipboard operation
Geocoder copied to clipboard

Error installing geocoder-php/nominatim-provider

Open abishekrsrikaanth opened this issue 2 years ago • 8 comments
trafficstars

When adding the package geocoder-php/nominatim-provider using composer, I get the following error

  Problem 1
    - Root composer.json requires geocoder-php/nominatim-provider ^5.7 -> satisfiable by geocoder-php/nominatim-provider[5.7.0].
    - geocoder-php/nominatim-provider 5.7.0 requires geocoder-php/common-http ^4.1 -> found geocoder-php/common-http[4.1.0, ..., 4.5.0] but the package is fixed to 4.0.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

abishekrsrikaanth avatar Jul 06 '23 01:07 abishekrsrikaanth

Can you show your composer.json file with other packages ?

After adding the package in composer.json you can try composer update geocoder-php/nominatim-provider geocoder-php/common-http

ybert avatar Jul 06 '23 07:07 ybert

The issue seems to persist because some of the other providers still use v4.0 of "geocoder-php/common-http" but geocoder-php/nominatim-provider using v4.1 and so does geocoder-php/maptiler-provider. I am getting the same error for maptiler as well.

if you try to install the following you will see this error occuring

composer require  geocoder-php/arcgis-online-provider geocoder-php/here-provider geocoder-php/locationiq-provider geocoder-php/mapbox-provider  geocoder-php/open-cage-provider geocoder-php/nominatim-provider geocoder-php/maptiler-provider

Just wondering why all the providers aren't using the same and the latest version of geocoder-php/common-http.

abishekrsrikaanth avatar Jul 06 '23 23:07 abishekrsrikaanth

I tried to install all these packages and I don't have any error.

I think you can try composer upadte geocoder-php/common-http geocoder-php/arcgis-online-provider geocoder-php/here-provider geocoder-php/locationiq-provider geocoder-php/mapbox-provider geocoder-php/open-cage-provider geocoder-php/nominatim-provider geocoder-php/maptiler-provider to fix it.

ybert avatar Jul 07 '23 08:07 ybert

@ybert what version of the nominatim and maptiler have you installed that allows installing all the above. because the depends command of composer clearly shows that all the other providers are currently set to ^4.0 and that is the reason the installation fails. The error message from composer is pretty clear. Just wondering how you are able to install it.

composer depends geocoder-php/common-http
geocoder-php/arcgis-online-provider 4.4.0 requires geocoder-php/common-http (^4.0)
geocoder-php/geo-plugin-provider    4.3.0 requires geocoder-php/common-http (^4.0)
geocoder-php/google-maps-provider   4.7.1 requires geocoder-php/common-http (^4.0)
geocoder-php/here-provider          0.7.0 requires geocoder-php/common-http (^4.0)
geocoder-php/locationiq-provider    1.4.0 requires geocoder-php/common-http (^4.0)
geocoder-php/mapbox-provider        1.4.0 requires geocoder-php/common-http (^4.0)
geocoder-php/mapquest-provider      4.3.0 requires geocoder-php/common-http (^4.0)
geocoder-php/open-cage-provider     4.6.0 requires geocoder-php/common-http (^4.0)
composer require geocoder-php/nominatim-provider
Using version ^5.7 for geocoder-php/nominatim-provider
./composer.json has been updated
Running composer update geocoder-php/nominatim-provider
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires geocoder-php/nominatim-provider ^5.7 -> satisfiable by geocoder-php/nominatim-provider[5.7.0].
    - geocoder-php/nominatim-provider 5.7.0 requires geocoder-php/common-http ^4.1 -> found geocoder-php/common-http[4.1.0, ..., 4.5.0] but the package is fixed to 4.0.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
composer require geocoder-php/maptiler-provider
Using version ^1.1 for geocoder-php/maptiler-provider
./composer.json has been updated
Running composer update geocoder-php/maptiler-provider
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires geocoder-php/maptiler-provider ^1.1 -> satisfiable by geocoder-php/maptiler-provider[1.1.0].
    - geocoder-php/maptiler-provider 1.1.0 requires geocoder-php/common-http ^4.1 -> found geocoder-php/common-http[4.1.0, ..., 4.5.0] but the package is fixed to 4.0.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

@jbelien could you please confirm the same on your end that you are able to install them all together

abishekrsrikaanth avatar Jul 07 '23 17:07 abishekrsrikaanth

In fact ^4.0 means 4.* so it should install 4.1 if available.

Did you try the composer update command with geocoder-php/common-http in it as shown in my last comment ? Composer suggested you to update it : geocoder-php/maptiler-provider 1.1.0 requires geocoder-php/common-http ^4.1 -> found geocoder-php/common-http[4.1.0, ..., 4.5.0] but the package is fixed to 4.0.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

ybert avatar Jul 07 '23 18:07 ybert

According to semantic versioning, ^4.0 and ^4.* means completely different.

^4.0 accepts all tags and releases under 4.0.1, 4.0.2, ...., 4.0.n but 4.* means 4.*.* and that is actually what the issue is.

Right now nominatim and maptiler are set to 4.1 on their composer files for geocoder-php/common-http and the rest use ^4.0, so there definitely is a conflict and you will not be able to add them together.

I have already tried running composer update geocoder-php/common-http

abishekrsrikaanth avatar Jul 07 '23 20:07 abishekrsrikaanth

With providers requiring geocoder-php/common-http ^4.0 and others requiring ^4.1 , I get the 4.5..0 installed.

Can you provide your composer.json file ? Maybe you have other packages that requires strict version or maybe your project have a direct dependency ?

ybert avatar Jul 07 '23 21:07 ybert

I don't have a direct dependency or related dependency. I already posted the output for composer depends above. It only shows geocoder projects. I am adding the output below again here

composer depends geocoder-php/common-http
geocoder-php/arcgis-online-provider 4.4.0 requires geocoder-php/common-http (^4.0)
geocoder-php/geo-plugin-provider    4.3.0 requires geocoder-php/common-http (^4.0)
geocoder-php/google-maps-provider   4.7.1 requires geocoder-php/common-http (^4.0)
geocoder-php/here-provider          0.7.0 requires geocoder-php/common-http (^4.0)
geocoder-php/locationiq-provider    1.4.0 requires geocoder-php/common-http (^4.0)
geocoder-php/mapbox-provider        1.4.0 requires geocoder-php/common-http (^4.0)
geocoder-php/mapquest-provider      4.3.0 requires geocoder-php/common-http (^4.0)
geocoder-php/open-cage-provider     4.6.0 requires geocoder-php/common-http (^4.0)

abishekrsrikaanth avatar Jul 07 '23 21:07 abishekrsrikaanth