3

drupal-composer/drupal-project drupal/recommended-project

Which one is the best option to choose & why? on Drupal 9

  1. composer create-project drupal/recommended-project:

/vendor: 4485 files, ~21 Mo

  1. composer create-project drupal-composer/drupal-project:

/vendor: 12624 files, ~62 Mo

1 Answer 1

7

The important difference is that you should use drupal/recommended-project as it is recommended and officially supported. drupal-composer/drupal-project is outdated for Drupal 8+ and should only be used for Drupal 7.

From the Using Composer to Install Drupal and Manage Dependencies documentation on d.o:

As of the release of Drupal 8.8.0 - the recommend composer template changed from drupal-composer/drupal-project to the officially supported: drupal/recommended-project

For Drupal 9, use the composer template at drupal/recommended-project. This template ensures Drupal Core dependencies are the exact same version as the official Drupal release.

For Drupal 7, use drupal-composer/drupal-project.

While alluded to in the quote from the d.o documentation, I think it's worth calling out: a key difference between the two templates is that drupal/recommended-project includes a composer.lock file which "ensures Drupal Core dependencies are the exact same version as the official Drupal release."

4
  • Yeah thanks Sonfd. but drupal composer available for Drupal 9. github.com/drupal-composer/drupal-project Jun 11, 2022 at 13:11
  • 1
    @ThirstySix drupal-composer can be used with Drupal 9 still but it is effectively obsolete, as stated in this answer. The new supported way is recommended-project, and the recommendation to use it is right there in the name. Jun 11, 2022 at 14:35
  • 2
    If you're asking why that repository has a 9.x version, that's something you're going to have to ask the maintainers in that project's issue queue. As stated, as of Drupal 8.8 (released 12/4/2019), drupal/recommended-project is the recommended and officially supported template.
    – sonfd
    Jun 11, 2022 at 14:52
  • Thank you PatrickKenny & sonfd Jun 11, 2022 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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