- Issue created by @zenimagine
- ๐บ๐ธUnited States mfb San Francisco
composer why-not drupal/core ^10
shows you have at least one project that doesn't have a drupal 10 release yet, drupal/menu_breadcrumb - ๐ซ๐ทFrance zenimagine
@mfb I just uninstalled the module, now I have this error and the update is not done :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires drupal/core-recommended 10.0.2 -> satisfiable by drupal/core-recommended[10.0.2].
- drupal/core-recommended 10.0.2 requires psr/log ~3.0.0 -> found psr/log[3.0.0] but these were not loaded, likely because it conflicts with another require.Installation failed, reverting ./composer.json and ./composer.lock to their original content.
- ๐บ๐ธUnited States mfb San Francisco
For me the easiest thing is to get a list of requirements:
composer show --no-dev --direct --name-only | xargs
and then use this to generate a new set of requirements, with minimal specification of versions so composer can figure out whatever works:
composer require composer/installers cweagans/composer-patches drupal/adsense:@RC drupal/allowed_formats drupal/antibot drupal/better_social_sharing_buttons drupal/core-composer-scaffold drupal/core-project-message drupal/core-recommended drupal/core-vendor-hardening drupal/diff drupal/easy_breadcrumb drupal/editor_advanced_link drupal/eu_cookie_compliance drupal/matomo drupal/metatag drupal/native_lazy_loading:@RC drupal/pathauto drupal/redirect drupal/schema_metatag drupal/scroll_top_button drupal/search404 drupal/simple_sitemap drupal/views_infinite_scroll drush/drush --update-with-all-dependencies
- ๐ซ๐ทFrance zenimagine
Thank you it works the solution and remove drush
- Status changed to Fixed
almost 2 years ago 2:39pm 22 January 2023 - ๐บ๐ธUnited States mfb San Francisco
Does drupal.org have any documentation on doing this? If not, I think we should add some.
If I recall correctly, composer's
--update-with-all-dependencies
option only updates dependencies of the things you are requiring. So you need to require all your requires, such that they and all their dependencies can be updated, not just drupal core. Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 11:52am 12 March 2023 - ๐ฉ๐ฐDenmark ressa Copenhagen
It looks to me like the
psr/log ~3.0.0
conflict is mainly a Drush issue so I have created Can't update from Drupal 9 to Drupal 10 with Drush installed #5461. - ๐ฉ๐ฐDenmark ressa Copenhagen
@weitzman helped me realize that this is the correct method to upgrade a Composer-based site from Drupal to Drupal 10: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-... โ
- ๐บ๐ธUnited States mfb San Francisco
@ressa I've seen those existing docs, but they don't mention that some projects will need to "require all their requires," as I described in #8 and #5 - i.e. those docs don't cover edge cases such as this issue.
With the above composer.json file in place, I tried the various documented commands such as requiring drupal 10 with the --no-update option and then running composer update, but that gave me the same "Your requirements could not be resolved to an installable set of packages" reported in the issue summary (confirmed with both composer 2.5.4 and composer 2.4.1)
- ๐ฉ๐ฐDenmark ressa Copenhagen
@mfb My Composer skills are extremely limited (where's https://www.drupal.org/u/mmjvb โ ?) so I can't really offer any help ... I am mostly just trying out the existing documentation, and trying to see if it works.
I hope you figure it out, and share it in the documentation pages if you do.
Also, since this issue is closed, perhaps you could consider opening a fresh issue, dedicated to solving your challenge?
- ๐บ๐ธUnited States mfb San Francisco
It's not my challenge and my solution is already here in #5 - I'm inquiring if the community has already documented this someplace or if I should add it to the existing documentation. Seems like maybe it's undocumented and I should add it.
- ๐บ๐ธUnited States mfb San Francisco
Ok I added a paragraph to https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-... โ
@ressa not offended at all :D just trying to figure out how we could improve the documentation on this
- ๐ฉ๐ฐDenmark ressa Copenhagen
Perfect, thanks for documenting it. Have a nice day!
- ๐จ๐ฆCanada sseto
@mfb. Thanks for creating the document. I used it and it fixed my issues!
- ๐ฌ๐งUnited Kingdom joachim
This needs to be re-opened, because the instructions at https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-... โ are insane. People expect Composer updates to work - instead you need to google and eventually land on an arcane set of steps.
> We use --no-update to avoid a chicken-and-egg problem with mutual dependencies:
What is the cause of the mutual dependency?
- ๐ฉ๐ฐDenmark ressa Copenhagen
I agree @joachim, it ought to be easier. It is based on the page https://www.drupal.org/docs/upgrading-drupal/drupal-8-and-higher โ , see the discussion โ .
- ๐จ๐ฆCanada Charlie ChX Negyesi ๐Canada
I documented how I did it: https://drupalusbcandmore.blot.im/d10up
- ๐ฌ๐งUnited Kingdom joachim
I installed a D9 site following the steps at https://ddev.readthedocs.io/en/latest/users/quickstart/#drupal
I then did: `composer require -W drupal/core-recommended ^10`
Output:
./composer.json has been updated Running composer update drupal/core-recommended --with-all-dependencies Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - drupal/core-recommended[10.0.0, ..., 10.1.5] require psr/log ~3.0.0 -> found psr/log[3.0.0] but these were not loaded, likely because it conflicts with another require. - Root composer.json requires drupal/core-recommended ^10 -> satisfiable by drupal/core-recommended[10.0.0, ..., 10.1.5].
I appreciate that several of people have figured out some steps to make this work, but my point is that these complex steps should not be necessary. Something is wrong: either in Drupal, or in Composer.
- ๐บ๐ธUnited States mfb San Francisco
It certainly would be neat if someone worked on a new composer command to update all your dependencies to new major versions, even without specifying them, but currently you have to explicitly require them for that to happen (as I attempted to document)
There has been widespread confusion and complications with these upgrades, and the situation is not improving.
- ๐จ๐ญSwitzerland berdir Switzerland
A separate issue was opened for this and I replied there: ๐ฌ Upgrading Drupal core to a new major version is very difficult when Drush is also installed Active
For those coming here and getting errors despite following the documentation and are stuck, I put together a post where I outlined my process, maybe that helps you: https://md-systems.notion.site/Major-Drupal-upgrades-with-composer-68c8c.... If even that doesn't help, then I recommend you ask in Slack in #d10readiness and share your composer.json or at least a version of it that allows to reproduce your problem if there are parts in it that you don't want to share.
I also made a small edit to the documentation page to make the steps slightly less complex, that is removing the --update-with-dependencies for composer --require. That does nothing when combined with --no-update, those are instructions for the implied composer update command that is skipped anyway.
Feel free to include more of my notes into the documentation page, I didn't want to make further non-trivial changes there.
In Slack, we also discussed that drupal/core-recommended is causing more problems than it solves and we might want to re-evaluate if we really want to keep recommending that. I never use it on our projects.
- ๐บ๐ฆUkraine SerShevchyk Lutsk
@Berdir I think you can add a command to step 3 in your documentation:
composer require --no-update drupal/core:^10.1 drupal/core-composer-scaffold:^10.1 drupal/core-project-message:^10.1
- ๐จ๐ญSwitzerland berdir Switzerland
No I specifically didn't do that. I like how Symfony does it in https://symfony.com/doc/current/setup/upgrade_major.html#2-update-to-the.... It doesn't give you an exact command because much more so for Symfony than Drupal, those packages aren't going to be the same for every project. I don't use project-message in my projects, and people might still have legacy projects, where they need to update vendor hardening and that require command would add scaffold as a new dependency which might just break stuff.
- ๐บ๐ธUnited States maxstarkenburg Washington, DC
What are the recommended steps if one wants to avoid running
composer update
sans arguments?Since that updates everything, it also includes directly-required contrib, and I don't want my update of core to be accompanied by the regressions I've found in the latest patch releases of
stage_file_proxy
andviewsreference
, for example.I know I can lock those two specific modules at specific versions, but I also don't want to have to wonder what other contrib's updates might have regressions, require time testing, etc. (whereas any regressions in core's dependencies will naturally have more eyeballs encountering them than contrib). Nor do I want to have to do manual
git add -p composer.lock
of course. - ๐จ๐ญSwitzerland berdir Switzerland
Well, you can try to explicitly list every single dependency that composer update -W foo bar baz but that's going to be *very* tedious with likely a lot of very confusing composer errors. The reality is that every contrib module needs to be updated to a version that is compatible with Drupal 10, and depending on how frequently you update, that will end up requiring to update basically everything anyway and there is no way around that.
- ๐ฎ๐ณIndia rohan_singh India
As per the documentation
https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-... โWhen we are upgrading only the core modules, with using
composer update "drupal/core-*" drush/drush --with-all-dependencies --dry-run
I am getting psr/log issues.
- Root composer.json requires drupal/core-recommended 10.0.11 -> satisfiable by drupal/core-recommended[10.0.11].
- drupal/core-recommended 10.0.11 requires psr/log ~3.0.0 -> found psr/log[3.0.0] but these were not loaded, likely because it conflicts with another require.