tuurbo's avatar
Level 11

Composer can't find package

I just updated the guzzle dependency in one of my packages to ~5.2 and now i get an error from composer when i try to install my package in my laravel project. I'm not a pro with composer but the version seems to exist on packagist... Am i doing something wrong?

package: https://github.com/tuurbo/spreedly

dependency: https://packagist.org/packages/guzzlehttp/guzzle

Problem 1
    - Installation request for tuurbo/spreedly ~1.0 -> satisfiable by tuurbo/spreedly[1.0.0].
    - tuurbo/spreedly 1.0.0 requires guzzlehttp/guzzle ~5.2 -> no matching package found.
0 likes
15 replies
toniperic's avatar

Can you show the composer.json file that you have updated?

tuurbo's avatar
Level 11

https://github.com/tuurbo/spreedly/blob/master/composer.json

{
    "name": "tuurbo/spreedly",
    "description": "Spreedly API",
    "keywords": ["spreedly", "laravel", "credit card", "payment"],
    "license": "MIT",
    "authors": [
        {
            "name": "Daniel Fraser"
        }
    ],
    "require": {
        "php": ">=5.4.0",
        "guzzlehttp/guzzle": "~5.2"
    },
    "require-dev": {
        "phpspec/phpspec": "~2.2"
    },
    "autoload": {
        "psr-4": {
            "Tuurbo\\Spreedly\\": "src/"
        }
    }
}
toniperic's avatar

Can you try changing

"guzzlehttp/guzzle": "~5.2"

to

"guzzlehttp/guzzle": "~5.2@stable"

Hope that helps.

1 like
tuurbo's avatar
Level 11

I pushed a branch called guzzle and ran composer require tuurbo/spreedly:dev-guzzle@dev and im getting

Problem 1
    - Installation request for tuurbo/spreedly dev-guzzle@dev -> satisfiable by tuurbo/spreedly[dev-guzzle].
    - tuurbo/spreedly dev-guzzle requires guzzlehttp/guzzle ~5.2@stable -> 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://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
jimmck's avatar

Packagist lists the latest at 6.0.2. I set the version to @stable. Also are you running PHP >= 5.5 ?

      "guzzlehttp/guzzle": "@stable",
Jamess-MacBook-Pro:laravel5 jimm$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing guzzlehttp/promises (1.0.0)
    Downloading: 100%

  - Installing psr/http-message (1.0)
    Downloading: 100%

  - Installing guzzlehttp/psr7 (1.0.0)
    Downloading: 100%

  - Installing guzzlehttp/guzzle (6.0.1)
    Downloading: 100%

Writing lock file
Generating autoload files
A new helper file was written to _ide_helper.php
Generating optimized class loader
Compiling common classes

tuurbo's avatar
Level 11

I was trying 5.2 because it didnt require php 5.5, but i'll give guzzle 6 a shot

tuurbo's avatar
Level 11

So i just created a empty folder called /test and ran composer require tuurbo/spreedly:dev-guzzle@dev and it ran successfully... So that must mean my laravel project is the issue, not the tuurbo/spreedly package?

toniperic's avatar

@tuurbo what Laravel has to do with you creating package that requires some other library?

tuurbo's avatar
Level 11

Not sure, but i can composer require the package from outside of my laravel project without an issue

tuurbo's avatar
Level 11

I'm assuming this might be the answer?

The package is not available in a stable-enough version according to your minimum-stability setting

jimmck's avatar
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing guzzlehttp/psr7 (1.0.0)
  - Removing psr/http-message (1.0)
  - Removing guzzlehttp/promises (1.0.0)
  - Installing react/promise (v2.2.0)
    Downloading: 100%

  - Installing guzzlehttp/streams (3.0.0)
    Downloading: 100%

  - Installing guzzlehttp/ringphp (1.1.0)
    Downloading: 100%

  - Removing guzzlehttp/guzzle (6.0.1)
  - Installing guzzlehttp/guzzle (5.3.0)
    Downloading: 100%

  - Installing tuurbo/spreedly (1.0.0)
      "guzzlehttp/guzzle": "@stable",
      "tuurbo/spreedly": "1.0.0",

Please or to participate in this conversation.