Php – Composer – The requested package exists as but these are rejected by your constraint

bundlecomposer-phpPHPstability

When I run my install from composer, I have this error :

λ composer install
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Error :

Problem 1
– The requested package antoineb1/smoney_bundle 1.0 exists as antoineb1/smoney_bundle[dev-master] but these are rejected by your constraint.

My composer.json

{
    "name": "project",
    "license": "proprietary",
    "type": "project",
    "minimum-stability": "dev",
    "prefer-stable" : true,
    "autoload": {
        "psr-4": {
            "": "src/"
        }
    },
    "config": {
        "preferred-install": "dist"
    },
    "repositories": [
        {
            "url": "bitbucket url",
            "type": "vcs"
        }
    ],
    "require": {
        "php": ">=5.5.9",
        "antoineb1/smoney_bundle": "1.0"
    }
}

Best Answer

The version constraint "1.0" is interpreted internally as "1.0.0.0-stable" version.

But the only version available is:

antoineb1/smoney_bundle[dev-master].

So you could change the specified version to either one of the following depending on what version is suitable for you:

  • 1.0.* (which is seen by composer as >=1.0.0.0-dev <1.1.0.0-dev -- probably won't work because there obviously aren't any versions in that package)
  • dev-master
  • dev-master#<hash>
  • @dev
  • etc.

See the composer schema for reference.

Related Topic