By user5950


2018-03-31 18:45:55 8 Comments

After I realized that the thing I mostly enjoyed using Drupal for the last 10 years, Drush, is being axed, I started to set up all new Drupal sites with Composer. Unfortunately I can't update core as I supposed to do it, as composer update drupal/core --with-dependencies leads to the following messages.

Package "drupal/core" listed for update is not installed. Ignoring.  
Loading composer repositories with package information  
Updating dependencies (including require-dev)  
Nothing to install or update  
Generating autoload files  
Drupal\Core\Composer\Composer::preAutoloadDump
Drupal\Core\Composer\Composer::ensureHtaccess

The content of the composer.json file is the following.

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0+",
    "require": {
        "ckeditor/autogrow": "4.7.2",
        "ckeditor/fakeobjects": "4.7.2",
        "ckeditor/image": "4.7.2",
        "ckeditor/link": "4.6.2",
        "codemirror/codemirror": "5.27.4",
        "composer/installers": "^1.0.24",
        "drupal/background_image_formatter": "^1.3",
        "drupal/backup_migrate": "^[email protected]",
        "drupal/bg_image_formatter": "^[email protected]",
        "drupal/bootstrap": "^3.6",
        "drupal/checklistapi": "^1.6",
        "drupal/clientside_validation": "^[email protected]",
        "drupal/contact_storage": "^[email protected]",
        "drupal/crop": "^1.3",
        "drupal/ctools": "^3.0",
        "drupal/ds": "^3.1",
        "drupal/entity_clone": "^[email protected]",
        "drupal/field_group": "^1.0",
        "drupal/honeypot": "^1.27",
        "drupal/image_effects": "^2.0",
        "drupal/image_url_formatter": "^[email protected]",
        "drupal/image_widget_crop": "^2.1",
        "drupal/layout_plugin": "^[email protected]",
        "drupal/linkit": "^4.3",
        "drupal/metatag": "^1.3",
        "drupal/path_alias_xt": "1.x-dev",
        "drupal/pathauto": "^1.0",
        "drupal/piwik": "^1.2",
        "drupal/redirect": "^[email protected]",
        "drupal/single_page_site": "^1.4",
        "drupal/sitemap": "^1.3",
        "drupal/social_media_links": "^2.6",
        "drupal/spamspan": "^[email protected]",
        "drupal/taxonomy_menu": "^3.3",
        "drupal/token": "^1.0",
        "drupal/video": "^1.2",
        "drupal/views_arg_order_sort": "1.x-dev",
        "drupal/views_bootstrap": "^3.0",
        "drupal/views_field_view": "^[email protected]",
        "drupal/webform": "^[email protected]",
        "drupal/webform_views": "^[email protected]",
        "drush/drush": "^8.1",
        "jquery/geocomplete": "1.7.0",
        "jquery/icheck": "1.0.2 ",
        "jquery/image-picker": "0.3.0",
        "jquery/inputmask": "3.3.7",
        "jquery/intl-tel-input": "12.0.0",
        "jquery/rateit": "1.1.1",
        "jquery/select2": "4.0.3",
        "jquery/timepicker": "1.11.11 ",
        "jquery/toggles": "4.0.0",
        "jquery/word-and-character-counter": "2.5.1",
        "progress-tracker/progress-tracker": "1.4.0",
        "signature_pad/signature_pad": "2.3.0",
        "wikimedia/composer-merge-plugin": "^1.4"
    },
    "replace": {
        "drupal/core": "^8.4"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php.",
            "This file specifies the packages.drupal.org repository.",
            "You can read more about this composer repository at:",
            "https://www.drupal.org/node/2718229"
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "core": [
                "type:drupal-core"
            ],
            "modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ],
            "libraries/{$name}": [
                "type:drupal-library"
            ]
        }
    },
    "autoload": {
        "psr-4": {
            "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
        }
    },
    "scripts": {
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "post-autoload-dump": [
            "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
        ],
        "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
        "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
    },
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "ckeditor.autogrow": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "ckeditor/autogrow",
                "version": "4.7.2",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "ckeditor.autogrow"
                },
                "dist": {
                    "url": "https://download.ckeditor.com/autogrow/releases/autogrow_4.7.2.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "ckeditor.fakeobjects": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "ckeditor/fakeobjects",
                "version": "4.7.2",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "ckeditor.fakeobjects"
                },
                "dist": {
                    "url": "https://download.ckeditor.com/fakeobjects/releases/fakeobjects_4.7.2.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "ckeditor.image": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "ckeditor/image",
                "version": "4.7.2",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "ckeditor.image"
                },
                "dist": {
                    "url": "https://download.ckeditor.com/image/releases/image_4.7.2.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "ckeditor.link": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "ckeditor/link",
                "version": "4.6.2",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "ckeditor.link"
                },
                "dist": {
                    "url": "https://download.ckeditor.com/link/releases/link_4.6.2.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "codemirror": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "codemirror/codemirror",
                "version": "5.27.4",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "codemirror"
                },
                "dist": {
                    "url": "https://github.com/components/codemirror/archive/5.27.4.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.geocomplete": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/geocomplete",
                "version": "1.7.0",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.geocomplete"
                },
                "dist": {
                    "url": "https://github.com/ubilabs/geocomplete/archive/1.7.0.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.icheck": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/icheck",
                "version": "1.0.2 ",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.icheck"
                },
                "dist": {
                    "url": "https://github.com/fronteed/icheck/archive/1.0.2.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.image-picker": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/image-picker",
                "version": "0.3.0",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.image-picker"
                },
                "dist": {
                    "url": "https://github.com/rvera/image-picker/archive/0.3.0.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.inputmask": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/inputmask",
                "version": "3.3.7",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.inputmask"
                },
                "dist": {
                    "url": "https://github.com/RobinHerbots/jquery.inputmask/archive/3.3.7.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.intl-tel-input": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/intl-tel-input",
                "version": "12.0.0",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.intl-tel-input"
                },
                "dist": {
                    "url": "https://github.com/jackocnr/intl-tel-input/archive/v12.0.0.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.rateit": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/rateit",
                "version": "1.1.1",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.rateit"
                },
                "dist": {
                    "url": "https://github.com/gjunge/rateit.js/archive/1.1.1.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.select2": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/select2",
                "version": "4.0.3",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.select2"
                },
                "dist": {
                    "url": "https://github.com/select2/select2/archive/4.0.3.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.timepicker": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/timepicker",
                "version": "1.11.11 ",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.timepicker"
                },
                "dist": {
                    "url": "https://github.com/jonthornton/jquery-timepicker/archive/1.11.11.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.toggles": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/toggles",
                "version": "4.0.0",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.toggles"
                },
                "dist": {
                    "url": "https://github.com/simontabor/jquery-toggles/archive/v4.0.0.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "jquery.word-and-character-counter": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "jquery/word-and-character-counter",
                "version": "2.5.1",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.word-and-character-counter"
                },
                "dist": {
                    "url": "https://github.com/qwertypants/jQuery-Word-and-Character-Counter-Plugin/archive/2.5.1.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "progress-tracker": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "progress-tracker/progress-tracker",
                "version": "1.4.0",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "progress-tracker"
                },
                "dist": {
                    "url": "https://github.com/NigelOToole/progress-tracker/archive/v1.4.0.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
        "signature_pad": {
            "_webform": true,
            "type": "package",
            "package": {
                "name": "signature_pad/signature_pad",
                "version": "2.3.0",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "signature_pad"
                },
                "dist": {
                    "url": "https://github.com/szimek/signature_pad/archive/v2.3.0.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        }
    }
}

Googling around I found many tips, but neither worked.

https://www.drupal.org/forum/support/upgrading-drupal/2018-02-01/update-to-850-through-composer-failure suggests to remove the vendor and core directories and run what didn't do the trick for me. Someone else suggests composer require drupal/core:8.5.1 which I didn't try, because it might work, but what sense would it make to add every release as a dependency, and this is what it means, right?

Why does "composer update drupal/drupal" not work? describes a similar issue. I couldn't make sense of the answers, but it may be that I lack the secret knowledge you need, to understand composer and Drupal 8.

https://www.drupal.org/forum/support/upgrading-drupal/2017-10-06/update-to-84-with-composer is a very long thread. It's hard to say what you should try, and what is too risky. Somebody says:

I was only able to update to 8.5.0 by manually changing the composer file:

drupal/core": "^8.5

and then running composer update --with-dependencies

Really? Do I have to edit the composer.json file before I can update? Is that the way to go?

Somebody else says:

"require”: { "drupal/core": "^8.4" },

not

"replace": { "drupal/core": "^8.4" },

Is this the way to go? But why is the core than under replace in the first place?

This is so frustrating! I find myself downloading zip files deleting folders and extracting other only to update Drupal 8, where before the only thing I had to do was running drush up drupal.

Can somebody help me?

1 comments

@Berdir 2018-04-01 14:15:42

Really? Do I have to edit the composer.json file before I can update? Is that the way to go?

The composer.json file specifies what packages/modules in which version you want to have installed.

So the general answer is, depending on what it contained, changing it is exactly what you need to do. See https://getcomposer.org/doc/articles/versions.md. To be able to update to 8.5, you need to tell composer that it is a valid version.

However, You only use drupal/core if you have a composer-based project, aka one that started based on https://github.com/drupal-composer/drupal-project/. If you just download a tarball from drupal.org then you have drupal/drupal and not drupal/core and I don't know if that can be updated with composer then.

My recommendation would be to start a new project based on drupal-project, then re-add all the dependencies you want and any custom module/theme that you had added. The only real difference is that now drupal itself and all the public files are in the web/ folder. That is more secure and allows to have varous things that should not be public in easily in the repository, like documentation, (behat) test. From then on, updating should be as easy as running composer update, as long as your version constraints allow an update.

Drush, is being axed,

The only part of drush that is "axed" is drush make, drush itself is definitely still around and maintained.

@mradcliffe 2018-04-01 15:44:43

I'm not sure I would recommend drupal-composer/drupal-project without knowing the web root as that project has specific expectation of where the web/drupal root is. IMO using drupal-scaffold separately is the best answer because it doesn't rely on any host-based expectations.

@Kevin 2018-04-01 15:46:59

You could also try Acquia BLT (which I prefer because it has CI scripts and a lot of other convenient things) their doc pages describe how to add BLT to an existing project - then boom, it is Composer controlled.

Related Questions

Sponsored Content

3 Answered Questions

[SOLVED] Updating core to a newer version

  • 2016-01-11 20:05:13
  • Yusef Mohamadi
  • 4945 View
  • 3 Score
  • 3 Answer
  • Tags:   8 updating

1 Answered Questions

1 Answered Questions

[SOLVED] "Your requirements could not be resolved to an installable set of packages"

  • 2018-11-13 12:40:03
  • Elie Masaad
  • 1773 View
  • 1 Score
  • 1 Answer
  • Tags:   8 webforms composer

1 Answered Questions

Composer update

  • 2018-10-18 21:57:32
  • ARMANDO SILVA
  • 42 View
  • 0 Score
  • 1 Answer
  • Tags:   updating composer

2 Answered Questions

[SOLVED] Why does RELAXed Web Services Not appear in the module list?

  • 2018-05-03 14:54:12
  • James R
  • 117 View
  • 0 Score
  • 2 Answer
  • Tags:   8 composer

0 Answered Questions

DrupalKernel not found, after install package with composer

  • 2018-03-12 14:51:01
  • Daniel Jean
  • 891 View
  • 0 Score
  • 0 Answer
  • Tags:   8 composer

0 Answered Questions

1 Answered Questions

[SOLVED] Core update error

1 Answered Questions

[SOLVED] Is there an automatic way to convert old versioning conventions?

  • 2017-04-09 19:31:17
  • therobyouknow
  • 224 View
  • 0 Score
  • 1 Answer
  • Tags:   8 updating composer

1 Answered Questions

[SOLVED] Drupal installed as composer package, Custom themes/modules folder

  • 2016-12-07 15:41:46
  • Andrew Welch
  • 83 View
  • 0 Score
  • 1 Answer
  • Tags:   composer

Sponsored Content