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


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.

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



  • ¥15 python中aiohttp.client_exceptions.ContentTypeError
  • ¥30 DeepLung肺结节检测生成最大froc值对应的epoch报错
  • ¥15 信号发生器如何将频率调大,步尽值改成10
  • ¥15 keil 5 编程智能家具,风扇台灯开关,人体感应等
  • ¥100 找一名渗透方面的专家
  • ¥20 使用Matlab APP设计一个插补小程序
  • ¥15 evo评估时曲线出现问题
  • ¥15 eNSP拓扑图配置实验
  • ¥20 有没有兄弟会替换fmod studio的.bank文件内的音效?
  • ¥20 如何解决访问网址被屏蔽的情况