【问题标题】:Composer conflicts GitHub tag with its commit hashComposer 将 GitHub 标签与其提交哈希冲突
【发布时间】:2016-06-25 07:35:08
【问题描述】:

当我使用很多包运行 composer update 时,我收到此错误:

Problem 1
    - Installation request for piwik/piwik dev-2491e6bfcf61984b0f0f3387e1496815e809c6cc -> satisfiable by piwik/piwik[dev-2491e6bfcf61984b0f0f3387e1496815e809c6cc].
    - myspace/MyPlugin 2.13.0 requires piwik/piwik >=2.16.0 -> satisfiable by piwik/piwik[2.16.0].
    - Can only install one of: piwik/piwik[2.16.0, dev-2491e6bfcf61984b0f0f3387e1496815e809c6cc].
    - Installation request for myspace/myplugin 2.13.0 -> satisfiable by myspace/MyPlugin[2.13.0].

奇怪的是,piwik 标签2.16.0dev-2491e6bfcf61984b0f0f3387e1496815e809c6cc 完全相同。此外,我没有看到任何需要 dev-2491e6bfcf61984b0f0f3387e1496815e809c6cc 的依赖 composer.json

这在我的主要composer.json。存储库定义为(https://github.com/myspace/MyPlugin.git 是假地址):

"repositories": {
  "myspace-myplugin": {
      "type": "vcs",
      "url": "https://github.com/myspace/MyPlugin.git"
  },
  "require": {
      "myspace/MyPlugin": "2.13.0"
  }
}

和依赖composer.jsonmyspace/MyPlugin要求:

"require": {
  "piwik/piwik": ">=2.16.0",
  "php": ">=5.4"
}

【问题讨论】:

    标签: github composer-php dependency-management


    【解决方案1】:

    我在piwik/piwik 上从无限制版本约束>=2.16.0 切换到范围^2.16 - 这将安装piwik/piwik (2.16.1-b1) atm。

    我还添加了minimum-stability beta,因为piwik 2.16.0 依赖于php-di 5.0.0-beta,在给定的稳定性级别无法解决。我们需要降低以获得测试版的东西。他们可能应该把它提升到一个稳定的版本。

    底线:请尝试以下composer.json

    {
        "require": {
          "piwik/piwik":     "^2.16",
          "php":             ">=5.4"
        },
        "minimum-stability": "beta"
    }
    

    经过测试并为我工作。

    【讨论】:

    • 我会试一试的。
    猜你喜欢
    • 1970-01-01
    • 2016-07-30
    • 1970-01-01
    • 1970-01-01
    • 2012-08-26
    • 1970-01-01
    • 2021-11-11
    • 2010-10-18
    • 2012-05-13
    相关资源
    最近更新 更多