This question already has an answer here:

I'm using a site created on Pantheon and now I'm not using pantheon.

So the core is not installed with composer. Now I want to upgrade core with composer but I don't understand how.

I've some modules installed with composer, so I try to add drupal/core :

compose require "drupal/core"

It's ok, but if I try to this, the aren't upgrades:

composer update drupal/core --with-dependencies

I've core 8.6.1 and I wanto to update to 8.6.2.


marked as duplicate by leymannx, 4k4, Clive Oct 18 '18 at 17:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • So the core is not installed with Composer. Now I want to upgrade core with Composer. What about installing it with Composer again? – leymannx Oct 18 '18 at 16:42
  • What do you mean? I try to add drupal/core but, after this, it does not find upgrades – arrubiu Oct 18 '18 at 16:43
  • What do you mean with it does not find upgrades? – leymannx Oct 18 '18 at 16:47
  • That is if i run "composer update "drupal/core" it tells me that there is nothing to install or upgrade – arrubiu Oct 18 '18 at 17:11

It is probably due to how the drupal/core line in your composer.json file is defined. It probably has the version locked to 8.6.1. So the update is saying: You are already at the version you requested. There are no updates.

I would try doing the following:

composer require drupal/core:8.6.2 --update-with-dependencies

This will tell composer to use that version and ignore the version info in the composer.json file.

  • It doesn't work. If I run that command, composer returns me: Nothing to install or update – arrubiu Oct 18 '18 at 16:56
  • What does the entry for drupal/core in your composer.json line say? Also, do you have the drupal repository added in your composer.json file. E.g.: "repositories": { "drupal": { "type" : "composer", "url" : "packages.drupal.org/8" }, – CG Monroe Oct 18 '18 at 17:04
  • yes, repo is there, because I've installed some modules with composer. Here is the compose.json: require": { "drupal/core": "8.6.2" }, "replace": { "drupal/core": "^8.6" }, – arrubiu Oct 18 '18 at 17:08
  • Hmm, I would remove the replace statement since this is not a forked version and change the 8.6.2 version to 8.6.1. Composer does not use Drupal version info just the composer version. Since it says 8.6.2, I think it assumes you have 8.6.2 installed. Then try the version specific require command. – CG Monroe Oct 18 '18 at 17:18
  • Removing the replace statement I've upgrade the core. Thanks a lot. Some guide suggests to upgrade also symfony: have I to do this? – arrubiu Oct 18 '18 at 17:27

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