dongyouji7022 2014-04-09 00:53
浏览 52
已采纳

与外部存储库的Composer依赖问题

I have written a library that I want to use in another project. However, when I add the library dependency to my project I get the following error after running composer update -vvv:

Your requirements could not be resolved to an installable set of packages.

Problem 1
    - Installation request for my/library dev-master -> satisfiable by my/library[dev-master].
    - my/library dev-master requires doctrine/migrations dev-master -> no matching package found.

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.

This error is very confusing to me since my project has my library as it's only dependency, i.e. my project composer.json looks like this:

{
    "name": "my/project",
    "type": "project",
    "description": "My project",
    "autoload": {
        "psr-0": { "MyNamespace\\": ["src/", "tests/src/"] }
    },
    "repositories": [ {
       "type": "vcs",
       "url": "git@bitbucket.org:my/library"
     } ], 
    "require": {
        "php": ">=5.5",
        "my/library": "dev-master"
    },
    "require-dev": {
        "phpunit/phpunit": "3.*"
    }
}

As you can see, pretty straight forward. The reason the version of my library is requiring dev-master is because master is currently the only branch I work on (I work alone, no need for other branches at the moment).

So far the only way for the resolve this problem is by adding the dependencies of my library composer.json to my project's composer.json which seems like an unnecessary step.

How can I resolve this dependency issue?

  • 写回答

1条回答 默认 最新

  • dongshu9458 2014-04-09 01:06
    关注

    It looks to me as if it is a stability issue. Add the following two lines to your composer.json:-

    "minimum-stability": "dev",
    "prefer-stable": true,
    

    ref:- minimum-stability & prefer-stable

    Hopefully that will sort out your problem.

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

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题