5

Now, a good amount of modules do not yet have a stable version, for example, webform. composer require drupal/webform says:

Could not find package drupal/webform at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

If I try composer require --minimum-stability=beta drupal/webform, I get:

The "--minimum-stability" option does not exist.

drush dl gives:

This codebase is assembled with Composer instead of Drush. Use composer update and composer require instead of drush pm-updatecode and drush pm-download.

Note that due to the special versioning of Drupal this is not a generic composer question but a Drupal specific one. Ie. webform today is 8.x-5.0-beta12, how do I install the latest in the 8.x-5.0 series...? Now, composer doesn't understand or use 8.x-5.0 but uses somethting else, but what and how does that work for betas? This needs documentation somewhere because it currently does not exist. I would be the happiest person if this didn't need an answer, but alas, despite having perfectly fine working tools to build sites, with Drupal 8 we need to use composer and most modules are in beta.

12

This installs the latest beta-12 for me:

composer require drupal/webform:5.0.*@dev

You need to do a bit of translation from the Drupal version number. From Using Composer to manage Drupal site dependencies:

Specifying a version you can specify a version from the command line with:

 $ composer require drupal/<modulename>:<version> 

For example:

 $ composer require drupal/ctools:3.0.0-alpha26
 $ composer require drupal/token:1.x-dev 

In these examples, the composer version 3.0.0-alpha26 maps to the drupal.org version 8.x-3.0-alpha26 and 1.x-dev maps to 8.x-1.x branch on drupal.org.

If you specify a branch, such as 1.x you must add -dev to the end of the version.

Hence for Webform, 8.5 becomes 5.0.x, and that's what you need to use to identify the package correctly.

|improve this answer|||||
  • The problem actually is github.com/composer/composer/issues/6426 this bug: git, make and vagrant all does something sensible when running in a subdir (git and vagrant goes up the tree, make just gives up) while composer creates an empty composer.json and doesn't display any error messages. facepalm – Smartsheet eng Jun 25 '17 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.