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

kevinquillen created an issue. See original summary.

kevinquillen’s picture

Issue summary: View changes
kevinquillen’s picture

I 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.

bojanz’s picture

Category: Bug report » Support request
Status: Active » Fixed

Always specify a version constraint ("^1.0" is fine).
Here the problem is possibly because drupal/entity was also a core module initially.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Carlos Miranda Levy’s picture

Title: Cannot install via Composer / Acquia BLT » Cannot install via Composer
Category: Support request » Bug report

This 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!

DuneBL’s picture

I 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

kevinquillen’s picture

From the project page:

  • The Drupal 8 core Entity API is significantly improved, so most of the features provided by the Drupal 7 version are already present in Drupal core.
  • The Drupal 8 version of the Entity API module is used for improvements to Drupal 8's Entity API which will be moved to Drupal core one day (development ongoing)
DuneBL’s picture

@kevinquillen thank you... I think I understand a little bit more

rgpublic’s picture

I 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.

Summit’s picture

Hi, +1 to have entity the 'normal' behavious for composer require drupal/entity !
or may be alter module name?
Thanks for considering this.
greetings, Martijn

fehin’s picture

Struggled 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.