Skip to main content
3 of 3
shorted the link to the other answer
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Create drupal-project with --no-install option:

composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --no-interaction --no-install

Change directories to my_site_name_dir and edit the version contraints in the composer.json file:

"require": {
    ...
    "drupal/core": "8.6.*",
    ...
},

Also for

"require-dev": {
    "webflo/drupal-core-require-dev": "8.6.*"
},

webflo/drupal-core-require-dev provides the require-dev dependencies of drupal/core as a standalone package. It follows the same release cycle and versioning scheme as Drupal core. You should use the same version constraint for it as you use for Drupal core.

Run composer install


Warning

Since answering the question the de-facto standard for installing Drupal via composer has changed from drupal-composer/drupal-project to drupal/recommended-project. Now you can append the version directly to the package. See Vinod Singh's answer.

4uk4
  • 101.7k
  • 7
  • 173
  • 217