2012-12-09 15:50
浏览 87

未找到Composer phar包

I am trying to create a new composer library package. I created the composer.json file using the

composer.phar create-project xlix vendor/xlix/xlix 0.3


In the filesystem the file composer.json exists under vendor/xlix/xlix and for testing purposes I copied it to vendor/xlix.

The composer.json file content is the following:

    "name": "xlix/xlix",
    "type": "library",
    "description": "XLIX package",
    "keywords": ["core"],
    "homepage": "http://myhomepage",
    "license": "GPL",
    "authors": [
            "name": "Florian Kasper",
            "email": "florian.kasper@mymail"
    "require": {
        "php": ">=5.2.4"
    "autoload": {
        "psr-0" : {
            "Xlix\\Bundle" : "lib/"
    "extra": {
        "branch-alias": {
            "dev-master": "1.0"

Then I tried the following commands:

git:(master) ✗  php composer.phar require xlix/xlix
git:(master) ✗  php composer.phat require vendor/xlix

git:(master) ✗  php composer.phar install vendor/xlix
git:(master) ✗  php composer.phar install xlix/xlix

Every time the same output:

Please provide a version constraint for the xlix/xlix requirement: *
composer.json has been updated
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

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

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

In my ROOTDIR/composer.json file the package is registered in the require section.

"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"kriswallsmith/assetic": "1.1.*@dev",
"xlix/xlix": ">=0.*"

Now I am on the edge of despair an don't know what to do anymore.


Are there any mistakes I've made or is there anything i missed?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doubei3312 2012-12-11 19:23

    Packages live on the internet, not on your filesystem.

    Composer searches by default for a package called xlix/xlix on packagist and that does not exists. You can add more package repositories by using the repositories configuration, more about that in the documentation.

    So, in order to require your package with composer you need to upload your xlix directory somewhere.

    I don't see what you are trying to do in the lxix directory? You are in the lxix package, why do you want to require it in the same package? It looks like you don't understand what those commands do and how composer works. Maybe a good read in their own documentation -- or some other tutorials about Composer (like the one on nettuts+) -- will help you to get a better understanding of composer.

    解决 无用
    打赏 举报

相关推荐 更多相似问题