Using composer require to get an alpha, beta, or release candidate of a Drupal 8 module
The composer require
command can help you get your requirements into composer.json more easily. However, that ease is more theoretical than actual for modules without a full stable release.
The Honeypot module has a full stable release version, so any of these will work:
composer require drupal/honeypot:8.*
composer require drupal/honeypot:8.x
composer require drupal/honeypot:8
composer require drupal/honeypot
But at the time of this writing, the current release of the Default content module is 8.x-1.0-alpha2. How is that supposed to look? It's a lot less forgiving than one that has a full release. To end the suspense, here is what default_content 8.x-1.0-alpha2 translated for composer looks like:
composer require drupal/default_content:8.1.0-alpha2
Of course, you can always look up what packages (modules, themes, profiles) are available at https://packagist.drupal-composer.org/ and get the full require line that way. Here, for instance, is the page for https://packagist.drupal-composer.org/packages/drupal/default_content
That's a lot easier than trying to guess the version string as used by composer and getting messages like '[UnexpectedValueException] Could not parse version constraint 8.-1.: Invalid version string "8.-1.'
Comments
Post new comment