【发布时间】:2021-11-26 13:42:59
【问题描述】:
我在composer.jsonrequire 部分中有以下行。
"johnpbloch/wordpress-core": "^5.8"
运行 composer outdated 告诉我,有一个 5.8.1 更新可用。据我了解,版本约束不应该阻止这个版本并且应该可以更新到它。
出于某种原因,运行composer update johnpbloch/wordpress-core 什么都不做。安装的版本保持在 5.8。 composer require johnpbloch/wordpress-core 也不会将软件包更新到最新版本。 Composer 只是一直告诉我没有什么可更新的。我不明白为什么。
我确实尝试直接为更新命令提供版本,composer update johnpbloch/wordpress-core:5.8.1,这给了我以下错误。
johnpbloch/wordpress 5.8.0 requires johnpbloch/wordpress-core 5.8.0 -> found johnpbloch/wordpress-core[5.8.0]
but it conflicts with your root composer.json require (^5.8, 5.8.1)
我有一种感觉,我在这里遗漏了一些明显的东西,但看不到什么。希望有人能阐明造成这种情况的原因。
这是我正在使用的精简版composer.json 文件。因为不想在这里分享,所以我省略了名称和描述。
{
"type": "project",
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"require": {
"wecodemore/wpstarter": "~2.0",
"johnpbloch/wordpress-core": "^5.8",
"wpackagist-plugin/wordpress-seo": "^17.3",
"inpsyde/wp-translation-downloader": "^2.0"
},
"config": {
"vendor-dir": "public_html/content/vendor",
"optimize-autoloader": true
},
"scripts": {
"post-install-cmd": "WCM\\WPStarter\\Setup::run",
"post-update-cmd": "WCM\\WPStarter\\Setup::run",
"wpstarter": "WCM\\WPStarter\\Setup::run"
},
"extra": {
"wordpress-install-dir": "public_html/wp",
"wordpress-content-dir": "public_html/content",
"wpstarter": {
"prevent-overwrite": [
".gitignore",
".htaccess",
"wp-config.php",
"index.php"
],
"env-example": "public_html/content/vendor/wecodemore/wpstarter/wpstarter/templates/.env.example",
"gitignore": {
"wp": true,
"wp-content": true,
"vendor": true,
"common": true,
"custom": [
"*.log",
".htaccess",
"sitemap.xml",
"sitemap.xml.gz"
]
}
},
"installer-paths": {
"public_html/content/plugins/{$name}": [
"type:wordpress-plugin"
],
"public_html/content/mu-plugins/{$name}": [
"type:wordpress-muplugin"
],
"public_html/content/themes/{$name}": [
"type:wordpress-theme"
]
},
"wp-translation-downloader": {
"languages": [
"fi",
"sv_SE"
],
"directory": "public_html/content/languages"
}
}
}
【问题讨论】:
-
johnpbloch/wordpress 5.8.0 requires johnpbloch/wordpress-core 5.8.0- 这似乎是一种非常明显的阻止更新的方法 -
@NicoHaase 但是为什么没有任何指定版本的
require也会失败?难道不应该对安装的内容发表评论并将软件包更新到最新版本吗?而且我只在指定确切版本时看到该错误。 -
这可能取决于您配置的其他内容。你能分享更多关于你的 composer.json 的细节吗?
-
@NicoHaase 是的,我在我的问题中添加了更多细节。
标签: composer-php