Help! Why does Composer keep installing Drupal 8.5 "BETA" instead of the stable version?

By Hawkeye Tenderwolf,
Image of code on screen, duplicated many times.

Help! Why does Composer keep installing Drupal 8.5 "BETA" instead of the stable version? (Image of code on screen, duplicated many times.)

Drupal core 8.5.0-stable was released just a few days ago, and I imagine other folks may run into the same installation problem as I did when attempting to upgrade. If you think this might be you, then read on...

Problem: When trying to upgrade from any previous version of Drupal core to ~8.5, Composer delivers 8.5.0-beta1 instead of the latest stable version.

Answer: Drupal core 8.5.0-beta2 introduced dependencies on some PHP extensions, which can't simply be downloaded from Packagist like other requirements. If you use a local development tool like Lando, DDEV, Docksal, or the like instead of a local stack, your local version of PHP may not have the necessary extensions. In that case, when you run composer locally instead of inside your development environment, the very latest version of Drupal it can grab is 8.5.0-beta1, the version before those PHP dependencies were introduced.

The quick fix: Just run the composer update command inside your local development environment. E.g.:

lando composer update drupal/core webflo/drupal-core-require-dev symfony/* --with-dependencies

A note of thanks to eriksm/orkj for his great article "Updating to Drupal 8.5 with composer" that got me 90% of the way there.

Derek "Hawkeye Tenderwolf" DeRaps

Senior Architect

The Masters of the Internet hath decreed that a champion web weaver must lead the progression of technology and science, and Kalamuna has followed suit by offering two-wheeling Derek DeRaps to the fast-paced arena of ever-changing requirements and challenges. With a fierce gaze and unrelenting laughter, he smashes our client’s worries and sorrows away in heroic fashion.