gpt4 book ai didi

composer-php - 无法将 Drupal Composer 要求解析为一组可安装的软件包

转载 作者:行者123 更新时间:2023-12-01 05:51:43 30 4
gpt4 key购买 nike

我在从 Composer 更新 Drupal 时遇到了麻烦。

运行 composer update 会给我这个错误,我需要帮助来解释:

使用包信息加载 Composer 存储库
更新依赖项(包括 require-dev)
无法将您的要求解析为一组可安装的软件包。

问题一

- don't install drupal/core 8.6.3|remove drupal/drupal dev-master

- don't install drupal/core 8.6.x-dev|remove drupal/drupal dev-master

- don't install drupal/core 8.7.x-dev|remove drupal/drupal dev-master

- Installation request for drupal/drupal dev-master -> satisfiable by drupal/drupal[dev-master].

- Installation request for drupal/core ^8.6.3 -> satisfiable by drupal/core[8.6.3, 8.6.x-dev, 8.7.x-dev].

我的 composer.json 文件如下所示:
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
"composer/installers": "^1.2",
"wikimedia/composer-merge-plugin": "^1.4",
"algolia/algoliasearch-client-php": "^1.14",
"drupal/raven": "^2.4",
"drupal/core": "^8.6.3"
},
"require-dev": {
"webflo/drupal-core-require-dev": "^8.6.0"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},

"extra": {
"_readme": [
"By default Drupal loads the autoloader from ./vendor/autoload.php.",
"To change the autoloader you can edit ./autoload.php.",
"This file specifies the packages.drupal.org repository.",
"You can read more about this composer repository at:",
"https://www.drupal.org/node/2718229"
],
"merge-plugin": {
"include": [
"core/composer.json"
],
"recurse": true,
"replace": false,
"merge-extra": false
},
"installer-paths": {
"core": ["type:drupal-core"],
"modules/contrib/{$name}": ["type:drupal-module"],
"profiles/contrib/{$name}": ["type:drupal-profile"],
"themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"],
"modules/custom/{$name}": ["type:drupal-custom-module"],
"themes/custom/{$name}": ["type:drupal-custom-theme"]
}
},
"autoload": {
"psr-4": {
"Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
}
},
"scripts": {
"pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
"post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "@composer update phpunit/phpunit --with-dependencies --no-progress",
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
]
}

最佳答案

这是与 PHP 和 Composer 版本的兼容性问题。我已将 PHP 7.1 版本更改为 Composer 1.7.2 以执行它。

如果您安装的 Composer 版本高于 1.7.2,则使用以下命令降级:

composer self-update 1.7.2

关于composer-php - 无法将 Drupal Composer 要求解析为一组可安装的软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53371954/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com