使用Composer为Symfony2安装Jasny / Bootstrap

时间:2013-02-21 17:01:35

标签: twitter-bootstrap symfony composer-php jasny-bootstrap

习惯使用Composer为Symfony2安装composer unaware软件包。 Twitter / Bootstrap的配置是:

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

但是有了Jasny / Bootstrap这个

    {
        "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"
            }
        }
    }

失败了

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

如何解决? 2.3.0-j4是最新版本。 “-j4”只是非标准和破坏作曲家吗?

不幸的是,根据建议尝试2.3。*和> = 2.3会导致类似的错误。

[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.*"}} 

1 个答案:

答案 0 :(得分:1)

版本必须遵循X.Y.Z的格式,后缀为-dev-alphaN-betaN-RCN

<{3}}提到的http://getcomposer.org/doc/04-schema.md#version

您可以尝试2.3.*>=2.3