【问题标题】:Composer - Install github fork/branchComposer - 安装 github fork/branch
【发布时间】:2015-02-25 09:12:40
【问题描述】:

为什么 composer 不能从 https://github.com/wimvds/DoctrineMigrationsBundle/tree/feature/multiple-em-support 安装分支?

我的 composer.json:

"repositories": [
    {
        "type":"package",
        "package": {
          "name": "doctrine/doctrine-migrations-bundle",
          "version":"master",
          "source": {
              "url": "https://github.com/wimvds/DoctrineMigrationsBundle.git",
              "type": "git",
              "reference":"master"
            }
        }
    }
],
"require": {
(...)
        "doctrine/migrations": "1.0.*@dev",
        "doctrine/doctrine-migrations-bundle": "dev-feature/multiple-em-support",
(...)
}.

错误:

composer update

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

  Problem 1
    - The requested package doctrine/doctrine-migrations-bundle dev-feature/multiple-em-support could not be 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.

没有“包”的更简单的方法工作:

"repositories": [
    {
      "url": "https://github.com/wimvds/DoctrineMigrationsBundle.git",
      "type": "git"
    }
],

【问题讨论】:

标签: php symfony doctrine composer-php doctrine-migrations


【解决方案1】:

试试这个

"repositories": [
{

      "source": {
          "url": "https://github.com/wimvds/DoctrineMigrationsBundle",
          "type": "git",
        }
    }
}
],
"require": {
(...)
    "doctrine/migrations": "1.0.*@dev",
    "doctrine/doctrine-migrations-bundle": "dev-feature/multiple-em-support",
(...)
}

【讨论】:

  • 只是说“必须定义类型”。我认为“类型”不能在“来源”中?
  • 只是给那些仍然有问题的人的说明。注意分支名称前的dev-。这不是分支名称的一部分,它是作曲家如何知道它的分支而不是标签版本的。
  • 这是一个重要的提示!谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-07-23
  • 1970-01-01
  • 2018-01-04
  • 2018-06-28
  • 2014-07-31
  • 1970-01-01
  • 2014-12-28
相关资源
最近更新 更多