我尝试安装最新版本的 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-stability
为dev
,甚至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
检查常见错误。