2

习惯于使用 Composer 为 Symfony2 安装 composer 不知道的包。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.*"}} 
4

1 回答 1

1

版本必须遵循 的格式,X.Y.Z并带有可选的后缀-dev, -alphaN,-betaN-RCN

来自cheesemacfly提到的http://getcomposer.org/doc/04-schema.md#version

您可以尝试2.3.*>=2.3代替。

于 2013-02-21T18:51:29.077 回答