0

I've forked drupal/recommended-project and run composer install from the default branch (8.8.x), it installed the latest dev version (8.8.6-dev). There's also a tag 8.8.5 (latest stable as of now) which has the same composer.json with the exception of these lines:

    "require-dev": {
        "drupal/core-dev": "^8.8"
    },

I've deleted these lines in branch 8.8.x hoping this would install the latest stable version but it installed the dev version anyway. I don't want to use tags because I forked the upstream and have my own changes.

How can I install the latest stable version of Drupal from the default branch (8.8.x)?

2

Instead of forking and running composer install, you should run composer create-project drupal/recommended-project <project_root_dir>. This will install the latest stable version of Drupal and you can of course add this to your version control system (don't forget to exclude all files that you don't have to track in your VCS).

When you use the composer.lock file from the GitHub repository directly, Composer installs the software versions as defined in the lock file (in this case the development versions).

| improve this answer | |
  • Thank you. Yes, I know that composer create-project would work but in my case, I need a fork. – csandanov Apr 10 at 3:46
  • @csandanov – Simply create the project and then do your changes afterwards. – leymannx Apr 10 at 6:53
2

I use a different one, drupal-composer/drupal-project and it installs the latest stable version.

Note: That as of Drupal 8.8.0 drupal-composer/drupal-project has been deprecated as an "official" source.

Note 2: But the project it self is not deprecated drupal-composer/drupal-project has [not] been deprecated

If you look at its composer.json

Under require it has

"require": {
    "drupal/core": "^8.8.0",
},
"require-dev": {
    "drupal/core-dev": "^8.8.0"
},

while yours doesn't; thus, this is why yours fetches the dev version.

| improve this answer | |
  • I don't think that only changing the requirement for "drupal/core" from "^8.8" into "^8.8.0" is going to make any difference, if you keep the original lock file (of drupal/recommended-project). In that lock file the version for "drupal/core" is set to "8.8.x-dev" (with commit "3db6f1077351e63a8ba1d0fb858f0d942f41b938"). – Watergate Apr 10 at 11:39
  • 1
    As a side note, as of Drupal 8.8.0 the drupal-composer/drupal-project has "officially" been deprecated. Though, it provides a lot of tools you probably want to include in your project. – Watergate Apr 10 at 11:40
  • 1
    @Watergate correct, he'll need to use composer update rather than composer install so it doesn't follow the lock file. – No Sssweat Apr 10 at 11:41
  • 1
    I used drupal-composer/drupal-project before but now prefer to follow the official project. By the way it is NOT deprecated github.com/drupal-composer/drupal-project/pull/550 – csandanov Apr 10 at 12:08
  • 1
    I'm still doing new sites from drupal-composer/drupal-project; I have used drupal/recommended-project, but in the end it looks just like a fresh drupal-composer/drupal-project once I got a good baseline set up for a real site. – mpdonadio Apr 10 at 16:47

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.