使用Composer获取Kohana的github repo失败:“找不到请求的包”

时间:2013-03-18 22:38:36

标签: kohana composer-php

我想使用Composer来包含php readability git项目。这是我的composer.json文件:

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "php-readability/php-readability",
                "version": "master",
                "source": {
                    "url": "https://github.com/feelinglucky/php-readability.git",
                    "type": "git",
                    "reference": "branches/master"
                }
            }
        }
    ],
    "require": {
        "php-readability/php-readability": "master"
    }
}

我得到的错误是:

Problem 1
 - The requested package php-readability/php-readability master could not be found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.

这是我第一次使用Composer,因此很可能我的配置错了!

1 个答案:

答案 0 :(得分:10)

php-readability项目没有标签(所以它在作曲家术语中不稳定)。默认情况下,只考虑稳定的包。

表示您要安装软件包的开发版本,请将其版本定义为“dev-master”或“* @ dev”。

此外,您在存储库定义中提供了错误的引用。这是一个有效的composer.json

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "php-readability/php-readability",
                "version": "master",
                "source": {
                    "url": "https://github.com/feelinglucky/php-readability.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],
    "require": {
        "php-readability/php-readability": "dev-master"
    }
}