7

After upgrading Drupal to the last version with Drush (8.1.15) the other composer.json dependencies (e.g. drupalconsole) are removed.

Are there any way to update Drupal with Drush keeping other composer dependencies?

diff --git a/docroot/composer.json b/docroot/composer.json index 6089861..b9536cf 100644 --- a/docroot/composer.json +++ b/docroot/composer.json @@ -4,28 +4,11 @@ "type": "project", "license": "GPL-2.0+", "require": { - "ckeditor/fakeobjects": "4.6.2", - "ckeditor/image": "4.6.2", - "ckeditor/link": "4.6.2", - "codemirror/codemirror": "5.27.4", "composer/installers": "^1.0.24", - "drupal/console": "~1.0", - "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" + "wikimedia/composer-merge-plugin": "^1.4" }, "replace": { - "drupal/core": "~8.3" + "drupal/core": "^8.4" }, "minimum-stability": "dev", "prefer-stable": true, 

I've seen that there is a composer project for Drupal but I'm not using it in this project.

4
  • 1
    "I've seen that there is a composer project for Drupal but I'm not using it in this project." ... then start. Commented Oct 13, 2017 at 8:14
  • @IvanJaros How you can you start using drupal.project on an already started project? Commented Oct 13, 2017 at 8:55
  • 1
    Just follow the instructions in here github.com/drupal-composer/drupal-project and then copy your sites directory in it. Commented Oct 13, 2017 at 9:12
  • Probably because it overwrote the composer.json file with whats on Drupal.org. Ivan is correct, you would need to use a Composer favoring solution like Drupal Project or Acquia BLT where this would not happen. Commented Oct 13, 2017 at 14:52

1 Answer 1

-1

If you have a composer based project, you probably should use composer to update it. E.g.:

composer update drupal/core --with-dependencies

Make sure to keep the composer.json, composer.lock, and docroot/vendor/composer/installed.json files in your repository.

Note: It's best to go 'all-in' with composer and use it to add and maintain modules as well as core. E.g.:

Add new module: composer require drupal/module

Update module: composer update drupal/module --with-dependencies

To manage patches, see the cweagans/composer-patches project.

You can also include various 3rd party libraries (e.g. chosen, colorbox, and the like) using your composer.json file.

1
  • 1
    I believe what the OP is asking about is a composer.json file that was overwritten during a core update, and losing all that information - not how to use Composer. Commented Oct 13, 2017 at 18:35

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.