When execute following commands:
- php modules/composer_manager/scripts/init.php
- composer drupal-update
Composer will report error message as below:
> Drupal\composer_manager\Composer\Command::update
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
- The requested package drupal/filter could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
From this point of view, we should say require "drupal/core", but not "drupal/filter".
Comments
Comment #2
hswong3i commentedComment #3
hass commentedWhy "core"? PHP need the core filter module. If this is not enabled the modules may not work.
Comment #4
hswong3i commentedFirst of all from Drupal 7 to Drupal 8 point of view:
*.makebecomecomposer.json, handling source code dependency management*.infobecome*.info.yml, handling functionality dependency managementSince "drupal/filter" is defined as "replace" (see https://getcomposer.org/doc/04-schema.md#replace) inside composer.json (see http://cgit.drupalcode.org/drupal/tree/core/composer.json?h=8.1.x), it is just a sub-package of "drupal/core". Therefore from source code dependency management point of view, we should say depend on its parent package "drupal/core".
On the other hand, PHP need the core filter module in order to get functioning, so its functionality dependency management should defined within php.info.yml. Therefore once enable PHP, Drupal will understand that also enable core filter module.
Long story short, composer.json !== php.info.yml
Comment #5
hass commentedGreat. Many thanks for the explaination!
Comment #7
hass commentedComment #9
WegPast commentedSo, I don't know if it's related but I was fighting against this error for a while even with the patch applied...
The only workaround I found was to replace the
"drupal/filter": "self.version",line with"drupal/filter": "*",in thecore/composer.json(Yeah I know that's bad to change core files...)On a Drupal 8.2.6, using latest
ComposerversionHope this workaround will be usefull for someone. And maybe I'll get an explanation of what happened :p