Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I type composer require drupal/entity
, this is the result:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpunit/phpunit-mock-objects dev-master requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
- drupal/core 8.0.0-beta6 requires phpunit/phpunit-mock-objects dev-master#e60bb929c50ae4237aaf680a4f6773f4ee17f0a2 -> satisfiable by phpunit/phpunit-mock-objects[dev-master].
- Installation request for drupal/entity ^0.1.0 -> satisfiable by drupal/entity[0.1.0].
- Conclusion: remove drupal/core 8.2.6
- Conclusion: don't install drupal/core 8.2.6
- drupal/entity 0.1.0 requires drupal/core <8.1.0 -> satisfiable by drupal/core[8.0.0, 8.0.0-beta10, 8.0.0-beta11, 8.0.0-beta12, 8.0.0-beta13, 8.0.0-beta14, 8.0.0-beta15, 8.0.0-beta16, 8.0.0-beta6, 8.0.0-beta7, 8.0.0-beta8, 8.0.0-beta9, 8.0.0-rc1, 8.0.0-rc2, 8.0.0-rc3, 8.0.0-rc4, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.x-dev].
- Can only install one of: drupal/core[8.0.0, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta10, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta11, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta12, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta13, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta14, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta15, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta16, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta7, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta8, 8.2.6].
- Can only install one of: drupal/core[8.0.0-beta9, 8.2.6].
- Can only install one of: drupal/core[8.0.0-rc1, 8.2.6].
- Can only install one of: drupal/core[8.0.0-rc2, 8.2.6].
- Can only install one of: drupal/core[8.0.0-rc3, 8.2.6].
- Can only install one of: drupal/core[8.0.0-rc4, 8.2.6].
- Can only install one of: drupal/core[8.0.1, 8.2.6].
- Can only install one of: drupal/core[8.0.2, 8.2.6].
- Can only install one of: drupal/core[8.0.3, 8.2.6].
- Can only install one of: drupal/core[8.0.4, 8.2.6].
- Can only install one of: drupal/core[8.0.5, 8.2.6].
- Can only install one of: drupal/core[8.0.6, 8.2.6].
- Can only install one of: drupal/core[8.0.x-dev, 8.2.6].
- Installation request for drupal/core (locked at 8.2.6, required as ^8.0) -> satisfiable by drupal/core[8.2.6].
I am running a fresh Drupal 8.2.6 install and PHP 5.6 is a requirement. Why is it having a problem with Drupal core itself, and am I being forced to upgrade to PHP 7.0? I can't do that on Acquia hosting.
Comments
Comment #2
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #3
kevinquillen CreditAttribution: kevinquillen at Velir commentedI basically had to do this instead:
composer require drupal/entity:1.0.0.0-alpha4
Or I could also do:
composer require drupal/entity:^1.0
Is Composer unable to determine version from tags? I can't tell why it was selecting 0.1.0.
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedAlways specify a version constraint ("^1.0" is fine).
Here the problem is possibly because drupal/entity was also a core module initially.
Comment #6
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy as a volunteer commentedThis is a bug, as composer is the officially recommended (not just preferred) way to install and manage Drupal core, contrib modules and manage libraries and dependencies.
As of current 8.x-1.0-alpha4 version, the correct command to install this module via composer would be (as indicated above):
composer require drupal/entity:^1.0
This should be mentioned on the module page and the README as well to save users time and troubles.
Great Work!
Comment #7
DuneBLI am a little bit lost...
If I understand well, entity is no more in core?
This mean that if, for exemple, we use node we must do
composer require drupal/entity:^1.0
?Or, maybe, this external entity module contains only extra feature that are used by some other modules (like media_entity)?
Could you kindly clarify this topic.
Thank you
Comment #8
kevinquillen CreditAttribution: kevinquillen at Velir commentedFrom the project page:
Comment #9
DuneBL@kevinquillen thank you... I think I understand a little bit more
Comment #10
rgpublicI think this is still a bug or at least a very unfortunate decision. I just installed LOTS of Drupal modules via composer. All via "require drupal/". The ONLY single module where this command isnt sufficient is the Entity module where you have to specify a version. I don't think it makes much sense that this module behaves different than any other Drupal module out there.
Comment #11
Summit CreditAttribution: Summit commentedHi, +1 to have entity the 'normal' behavious for composer require drupal/entity !
or may be alter module name?
Thanks for considering this.
greetings, Martijn
Comment #12
fehin CreditAttribution: fehin commentedStruggled today to install this module. It would be nice to have a note on the project page that indicates the module version needs to be included for composer.