为什么 Composer 不将包更新为补丁版本?
Why Composer isn't updating a package to patch version?
我在 composer.json
require
部分中有以下行。
"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"
}
}
}
你运行:
composer update johnpbloch/wordpress-core:5.8.1
这导致错误
johnpbloch/wordpress 5.8.0 requires johnpbloch/wordpress-core 5.8.0
所以答案很简单:jp/wordpress-core:5.8.1 与 jp/wordpress:5.8.0 冲突需要显式 jp/wordpress-core:5.8.0(不允许任何补丁版本更新).
求解:运行 composer update johnpbloch/wordpress-core johnpbloch/wordpress
它会将两个软件包列入白名单以进行更新并解决可能的最新版本
我在 composer.json
require
部分中有以下行。
"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"
}
}
}
你运行:
composer update johnpbloch/wordpress-core:5.8.1
这导致错误
johnpbloch/wordpress 5.8.0 requires johnpbloch/wordpress-core 5.8.0
所以答案很简单:jp/wordpress-core:5.8.1 与 jp/wordpress:5.8.0 冲突需要显式 jp/wordpress-core:5.8.0(不允许任何补丁版本更新).
求解:运行 composer update johnpbloch/wordpress-core johnpbloch/wordpress
它会将两个软件包列入白名单以进行更新并解决可能的最新版本