Search code examples
twitter-bootstrapsymfonycomposer-phpjasny-bootstrap

Installing Jasny/Bootstrap with Composer for Symfony2


Getting used to installing composer unaware packages for Symfony2 using Composer. The configuration for Twitter/Bootstrap was:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "twitter/bootstrap",
            "version": "2.3.0",
            "source": {
                "type": "git",
                "url": "https://github.com/twitter/bootstrap",
                "reference": "v2.3.0"
            }
        }
    }
 ],

but with Jasny/Bootstrap this

    {
        "type": "package",
        "package": {
            "name": "jasny/bootstrap",
            "version": "2.3.0-j4",
            "source": {
                "type": "git",
                "url": "https://github.com/jasny/bootstrap",
                "reference": "2.3.0-j4"
            }
        }
    }

fails with this

[UnexpectedValueException]                                                      
Could not parse version constraint 2.3.0-j4: Invalid version string "2.3.0-j4" 

How to fix? 2.3.0-j4 is the latest version. Is the"-j4" simply non-standard and breaking composer?

Unfortunately trying 2.3.* and >=2.3 as suggested results in similar errors.

[Composer\Repository\InvalidRepositoryException]
A repository of type "package" contains an invalid package definition: Undefined index: version

Invalid package definition:
{"name":"jasny\/bootstrap","version":"2.3.*","source":{"type":"git","url":"https:\/\/github.com\/jasny\/bootstrap","reference":"2.3.*"}} 

Solution

  • Version must follow the format of X.Y.Z with an optional suffix of -dev, -alphaN, -betaN or -RCN

    from http://getcomposer.org/doc/04-schema.md#version as mentioned by cheesemacfly.

    You can try 2.3.* or >=2.3 instead.