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.

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

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵