Question

I asked this on the composer-dev mailing list, but the community is not as active as SO.

I recently published this package on Packagist with a 1.0.0-dev version, then shortly afterwards I added some documentation and released it as 1.0.1. (Both releases done with Git tags)

In testing the deployment with a simple require foo/bar ~1.0 Composer tells me "Your requirements could not be resolved to an installable set of packages." The same happens when I specify the explicit version as "1.0.1"

So I tried pulling it down with require foo/bar dev-master which works fine. Then I edited composer.json changing "dev-master" to "1.0.1" and ran composer update - This now gives a more explicit messaging saying "The requested package foo/bar 1.0.1 could not be found."

Version 1.0.1 is clearly on the Packagist website, so I don't know what I've done wrong that composer does not identify it.

Was it helpful?

Solution 2

I hate answering my own question this way, but it looks very much like Packagist has a delay when updating packages.

Even with service hooks implemented properly I find it usually takes some minutes before I can update test builds with newly deployed versions.

On this particular day, it appeared to take hours, but as best as anyone can tell me there's nothing wrong with the steps I've listed above.

OTHER TIPS

I did the following:

mkdir testdir
cd testdir
composer init 
// answer all questions with default values, resulting in a new, clean composer.json

composer require loco/swizzle:~1.0

Result:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing psr/log (1.0.0)
    Downloading: 100%

  - Installing monolog/monolog (1.7.0)
    Downloading: 100%

  - Installing symfony/event-dispatcher (v2.4.1)
    Downloading: 100%

  - Installing guzzle/guzzle (v3.8.1)
    Downloading: 100%

  - Installing loco/swizzle (1.0.1)
    Downloading: 100%

Your problem cannot be reproduced by the information you gave. My resulting composer.json is:

{
    "name": "test/test",
    "authors": [
        {
            "name": "Test User",
            "email": "test@test.example"
        }
    ],
    "require": {
        "loco/swizzle": "~1.0"
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top