Semantic MediaWiki 需要 onoi/callback-container,但无法安装

Semantic MediaWiki 需要 onoi/callback-container,但无法安装

我尝试安装最新版本的 SemanticMediaWiki。当我运行 时composer update,它返回以下内容:

> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mediawiki/semantic-media-wiki 2.4.x-dev requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - mediawiki/semantic-media-wiki 2.4.6 requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - mediawiki/semantic-media-wiki 2.4.5 requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - mediawiki/semantic-media-wiki 2.4.4 requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - mediawiki/semantic-media-wiki 2.4.3 requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - mediawiki/semantic-media-wiki 2.4.2 requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - mediawiki/semantic-media-wiki 2.4.1 requires onoi/callback-container ~1.0 -> satisfiable by onoi/callback-container[1.0.0, 1.1.0] but these conflict with your requirements or minimum-stability.
    - Installation request for mediawiki/semantic-media-wiki ~2.4.1 -> satisfiable by mediawiki/semantic-media-wiki[2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.x-dev].

我甚至将 设置minimum-stabilitydev,甚至prefer-stable设置为false。但没有任何效果。

这不是 Composer 第一次出现问题。它返回了错误,因为version包中没有设置mediawiki/core,而这个 SMW 仍然需要这个包。但这次不是,令人惊讶。

并且 Composer 看不到 中的包composer show onoi/callback-container。根本没有稳定版本 2.0。

答案1

仔细检查您的composer.json版本以及您需要的版本,这个文件对我有用:

{
  "require-dev": {
    "mediawiki/semantic-media-wiki": "~2.4.1"
  }
}

相当于composer require mediawiki/semantic-media-wiki:~2.4.1命令。

如果composer show没有看到正确的包,请尝试以下命令:

  • composer clean清除缓存。
  • composer diagnose检查常见错误。

相关内容