1

I am trying to use my repo with composer. Fetching it as type package etc. worked well, but I would like to use it as a VCS.

So, I added a composer.json to my repository looking like this:

{
    "name": "gkm/storage",
    "authors": [
        {
            "name": "David Schunke",
            "email": "[email protected]"
        }
    ],
    "require": {
        "php": ">=5.3.0"
    },
    "autoload": {
        "psr-0": {
            "Gkm\\storage\\": ""
        }
    }
}

In the project, where I woult like to use the library from this repository, I added this composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "[email protected]:gkm/storage.git"
        }
    ],
    "require": {
        "gkm/storage": "*"
    }
}

Now, when I perform a composer update, it returns an error:

Problem 1 - The requested package gkm/storage could not be found in any version, there may be a typo in the package name.

Unfortunately, I do not find very detailed information about this. Comparing it to third party libraries which do the same, but are just published via packagist.org instead of a custom repo server, it looks the very same.

Hope someone here will see whats wrong.

1
  • change "gkm/storage": "*" to "gkm/storage": "dev-master"
    – PauAI
    Commented Feb 14, 2017 at 5:33

1 Answer 1

2

Did you tag a version? If not, Composer is unable to resolve "*" to a version, and you didn't allow development stability for that installed package.

2
  • I added the tag "0.0.1-alpha" to my repository. This still did not work, so I added the tag "v0.0.1-alpha" to preclude that it was about the "missing" "v", but that does not work as well. What works is using the branch aliasing like "dev-master" which suffices for now, but some day I would like to use tags and versioning.
    – Cravid
    Commented Jan 29, 2015 at 8:43
  • @sven - This solved my issue. For some reason I thought * would resolve the tip of master. Thanks. Commented Feb 23, 2015 at 23:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.