2

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.*"}} 
Arnold Daniels
  • 16,516
  • 4
  • 53
  • 82
Fo.
  • 3,752
  • 7
  • 28
  • 44
  • The version your putting there is not valid: http://getcomposer.org/doc/04-schema.md#version But don't ask me what to put instead, I dont know :) – cheesemacfly Feb 21 '13 at 17:46

1 Answers1

1

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.

Community
  • 1
  • 1
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
  • @Fo. And if you remove the version line from your file? From getcomposer.org: `Note: Packagist uses VCS repositories [...]. Specifying the version yourself will most likely end up creating problems at some point due to human error.` – cheesemacfly Feb 21 '13 at 19:46
  • dev-master works. So, I guess this means that I will never be able to rely on a stable release? – Fo. Feb 21 '13 at 21:41
  • For now you can't. However this is already reported as an issue. https://github.com/jasny/bootstrap/issues/80 – DarkLeafyGreen Feb 22 '13 at 07:46
  • It turns out the developers of Jasny Bootstrap feel this is a bug with Composer and closed the ticket. Oh well! – Fo. Feb 27 '13 at 16:28