0

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.

4

2 回答 2

0

我做了以下事情:

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

结果:

./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%

您提供的信息无法重现您的问题。我生成的 composer.json 是:

{
    "name": "test/test",
    "authors": [
        {
            "name": "Test User",
            "email": "test@test.example"
        }
    ],
    "require": {
        "loco/swizzle": "~1.0"
    }
}
于 2014-02-10T19:35:11.500 回答
0

我讨厌以这种方式回答我自己的问题,但看起来很像 Packagist 在更新软件包时有延迟。

即使正确实施了服务挂钩,我发现通常需要几分钟才能使用新部署的版本更新测试版本。

在这个特殊的日子里,它似乎需要几个小时,但任何人都可以告诉我上面列出的步骤没有任何问题。

于 2014-02-17T14:06:29.967 回答