duanne9313 2012-12-09 15:50
浏览 91
已采纳

未找到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

command.

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.

Question:

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 simulink中怎么使用solve函数?
  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题