By steveplayshorn on
Hi!
I'm having difficulty updating my current Drupal version 8.6.4 to 8.6.7 using composer.
After typing the command:
composer update drupal/core --with-dependenciesI get this error message:
[~/public_html]# composer update drupal/core --with-dependencies
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- don't install drupal/core 8.6.0|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-alpha1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-beta1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-beta2|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-rc1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.2|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.3|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.4|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.5|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.6|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.7|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.x-dev|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.7.x-dev|remove drupal/drupal No version set (parsed as 1.0.0)
- Installation request for drupal/drupal No version set (parsed as 1.0.0) -> satisfiable by drupal/drupal[No version set (parsed as 1.0.0)].
- Installation request for drupal/core ^8.6 -> satisfiable by drupal/core[8.6.0, 8.6.0-alpha1, 8.6.0-beta1, 8.6.0-beta2, 8.6.0-rc1, 8.6.1, 8.6.2, 8.6.3, 8.6.4, 8.6.5, 8.6.6, 8.6.7, 8.6.x-dev, 8.7.x-dev].
My composer.json looks like this:
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0-or-later",
"require": {
"composer/installers": "^1.0.24",
"wikimedia/composer-merge-plugin": "^1.4",
"drupal/commerce": "^2.11",
"drupal/swiftmailer": "^1.0@beta",
"drupal/commerce_stripe": "^1.0",
"drupal/honeypot": "^1.29",
"drupal/coder": "^8.3",
"drupal/core": "^8.6"
},
"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": true,
"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"]
}
},
"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",
"drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
"drupal-phpunit-upgrade": "@composer update phpunit/phpunit phpspec/prophecy symfony/yaml --with-dependencies --no-progress",
"phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --",
"phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
]
}Any ideas? Thanks!
Steven
Comments
If you have not yet read Jay
If you have not yet read Jay Friendly's 2 part blog post, (Part One, Part Two), on his interpretation of how composer works, then I suggest you go through it and test out your own examples to create a better understanding.
Same problem after upgrade 8
Same problem after upgrade 8.6.2 to 8.6.7 :
In my local with composer 1.7.2 : OK
In my production server with composer 1.8.0 NOT OK
In my development server with composer : 1.5.2 OK
I don't know if it's related, below my composer.json
Problem 1
- don't install drupal/core 8.6.0|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-alpha1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-beta1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-beta2|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.0-rc1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.1|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.2|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.3|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.4|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.5|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.6|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.7|remove drupal/drupal No version set (parsed as 1.0.0)
- don't install drupal/core 8.6.x-dev|remove drupal/drupal No version set (parsed as 1.0.0)
- remove drupal/drupal No version set (parsed as 1.0.0)|remove drupal/core 8.6.7
- Installation request for drupal/drupal No version set (parsed as 1.0.0) -> satisfiable by drupal/drupal[No version set (parsed as 1.0.0)].
- Installation request for drupal/core ~8.6.0 -> satisfiable by drupal/core[8.6.0, 8.6.0-alpha1, 8.6.0-beta1, 8.6.0-beta2, 8.6.0-rc1, 8.6.1, 8.6.2, 8.6.3, 8.6.4, 8.6.5, 8.6.6, 8.6.7, 8.6.x-dev].
Same issue updating to 8.6.7
I'm having the same issue. I just tested this with a vanilla core of 8.6.5 and using composer to update it to 8.6.7. my only changes were requiring core to be greater than 8.6.5 and adding in a composer merge plugin. The rest is the default from here.
Composer file:
Error:
PHP version:
Looks to be the version of composer
In our internal testing here it looks like its the version of composer that is causing this issue.
1.8 seems to be the cause of the issues in our tests. I rolled composer back to version 1.7.2 and it worked for me. I tested with both php7.1 and 7.2. Let me know if anyone else has similar results.
I roll back to 1.7.3 (I was
I roll back to 1.7.3 (I was on 1.8), but the error message is still there...
I rool back to 1.7.2, error messages desappears...thanks !
www.almedestudio.com
1.7.2 WORKS!!
I had the same problem with composer, I thought it was a dependency issue.
Reverting to v1.7.2(was using 1.8) worked for me :)
Composer issues - 1.7.2 Works
Yup, this was exactly our case as well, composer 1.8 and 1.7.3 would fail but after reverting to 1.7.2 the composer instal finished without any issues. I'm assuming this is related since we just recently updated Drupal to 8.6.7.
1.7.2 is it
In case it needs further confirmation, the problem is composer and going back to 1.7.2 works.
Steve Turnbull, D8 developer
Like Science Fiction, Fantasy or Steampunk stories? Check out https://taupress.com/book-list
How to roll back composer to
How to roll back composer to version 1.7.2:
composer self-update 1.7.2
Maybe composer.json issue
I noticed that the composer.json from drupal 8.6.7 ( and older 8.6 version) have settings that I don't have in mine :
https://github.com/drupal/drupal/blob/8.6.x/composer.json
"replace": {"drupal/core": "^8.6"
},
Maybe it's the issue ?
Indeed , that is the issue
You are trying to use drupal/drupal for something it wasn't intended for. Suggest to convert to a proper distribution if you want to build sites. Use drupal/drupal for code development, not site building. It wasn't intended to update with drupal/core. It contains drupal/core in the package, not as requirement.
How would one go about
How would one go about converting to a proper distribution?
There are a lot options.
See documentation and look for composerize.
EDIT No longer recommending gocomposer. Looks like a time waster!
The latest addition is https://github.com/WebKings-ca/gocomposer
Why did it stop working then?
I'm confused. Core was always working in older composer if you required it up until composer 1.8 using drupal/drupal. What changed? Is this a bug in Drupal or more of an issue with composer itself? Also doesn't that make this not accurate?
https://www.drupal.org/docs/8/update/update-core-via-composer
drupal/drupal is a package of type project, to be used ..
in `composer create-project`, which will download it and issue `composer install`. Core worked because it is part of the package. It wasn't on the require list of packages. This package was meant for development of Drupal core. Not for managing code base for your sites. drupal/drupal was not meant for updating using drupal/core in require list. Many tried and are now finding out that it takes more than moving drupal/core to the require list. Hence the advice to migrate from drupal/drupal to drupal-composer/drupal-project with gocomposer.
No idea what you mean with the documentation not being accurate. It does leave out a lot of essential information.
I downloaded and older build
I downloaded and older build of Drupal via Drush:
drush dl drupal-8.6.3
I run this:
composer outdated "drupal/*"
Which doesn't do anything.
I then run this:
composer update drupal/core --with-dependencies
And since its not required in the vanilla composer.json file I get this message:
Package "drupal/core" listed for update is not installed. Ignoring.
Which is at the top of that documentation.
I'm just wondering why it used to work until composer itself got to 1.8, and it still works the older way in composer 1.7.2? I guess that's why it confuses me and why I now need some 3rd party to update core if I'm on a more recent version of composer?
This never worked
./core/lib/Drupal.php: const VERSION = '8.6.2';
Why time waster?
@mmjvb, Why do you think gocomposer plug-in is a "time waster"?
I recently had the same issue
I recently had the same issue and solve it removing the merge-plugin array.
No, you didn't!
That didn't solve it, at least not when we are talking about the same issue. Those instructions are there for a reason. You need to bring your project under control of composer properly. Messing with it without knowing what you are doing is asking for problems.
You want to build sites and manage the code base with composer? Make sure you started with a proper distribution. That excludes the standard downloads and drupal/drupal. They are not meant to be maintained with composer (yet).
Please, let other people
Please, let other people having the same issue report if this solve it or not.
Your response does not help, and from what i see, no-one find a solution except downgrading composer.
No, your response doesn't help
What you did, didn't solve the issue. When it did, it wasn't the same issue!
removing "merge-plugin" in
removing "merge-plugin" in "extras" helped me
I created and managed my
I created and managed my project using composer but faced same problem. At last I solved it moving the project to drupal-project composer template. And it was not the end. Composer worked fine but it occured that default local PHP version was 7.2 while site worked on 7.0. Only when I fixed it I made everything work. Possibly this was the real reason.
Indeed, the only solution!
You should mirror the live infrastructure as close as possible to prevent these surprises. Doubt that it was the real reason, because it is well known that drupal/drupal or the standard archives don't allow updating drupal/core. Those `templates` are not meant for updating drupal with composer. They are meant for code contribution, not site creation in the era of composer.
Well it did work until
Well it did work until composer 1.7.3 came out. Since then it hasn't.
That is because you did the wrong thing.
You don't get punished straight away when doing things wrong. You better do it right!
Still an issue with composer 1.8.4
This still seems to be an issue with newer composer and PHP 7.2, in my case PHP 7.2.15. I just grabbed Drupal 8.6.10 and did the same method of updating that had previously worked and its not working. Its still not clear to me if the issue is with core, composer, or both. Staying on 1.7.2 works for me still.
Fixed in Drupal core 8.6.12
Drupal core 8.6.12 fixed the issue for me. However after updating composer, it removed drupal/core from composer's list of dependencies.
So I had to run this in drupal root directory.
rm -r corecomposer update
composer require drupal/coreAgain, not the same issue!
Regardless of how you started with drupal/drupal, the only correct way to use it for site building is to migrate it to a proper distribution. drupal/drupal is meant for code contribution. Moving drupal/core from replace to require is not enough!
No way that a new version of drupal is going to solve this for you!
Still an issue for me
I was able to install Drupal in this way, but when I try to add a module and update Drupal again, I'm getting the naming error.
Steps I did:
That part worked. Then I went to require a standard module like webform, and then I'm still seeing the same namespace error:
Let me know if you see the same thing in your tests. I'm on composer 1.8.4 in my tests.
This is most likely caused by the merge plugin configuration
Everyone: see https://www.drupal.org/project/drupal/issues/3020337
Like is said 1 month ago.
Like is said 1 month ago. Thanks for the linked issue @cilefen
To convert site from drupal
To convert site from drupal/drupal to the recommended drupal-composer/drupal-project template, I found the instructions on this article worked well: https://www.reddit.com/r/drupal/comments/b9z3pu/howto_manually_convert_existing_drupal_8_site_to/
Use GoComposer Plugin if facing this issue
The reason for such errors when updating Drupal 8 site is that the "drupal/drupal" composer template has been deprecated this can be seen in the following link:
https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies#deprecated-drupal-drupal
To fix it you need to switch to the recommended "drupal-composer/drupal-project" composer template seen in the following link:
https://github.com/drupal-composer/drupal-project/blob/8.x/composer.json
I would recommend to use the GoComposer Plugin in the following link:
https://github.com/WebKings-ca/gocomposer
What it will do is switch your Drupal 8 site to the recommended Composer template, Update to latest Drupal 8 core version, change folder structure of your site to a more secure setup where your Database credentials are not web accessible and update the database. You can see the Demo I made on how to use it here:
https://www.youtube.com/watch?v=13tLIoSKr0s&t=12s
If your facing any errors/issues when using the GoComposer Plugin please post them in the following link:
https://github.com/WebKings-ca/gocomposer/issues
Enjoy!
"drupal-composer/drupal-project" no longer valid
"drupal/core-recommended: "^8.8"
https://www.drupal.org/docs/develop/using-composer/using-composer-to-ins...
https://drupalize.me/tutorial/update-drupal-versions-prior-88x-using-composer?p=3233
-- Christian