Hi,

I'm getting the following error when requiring commerce_mollie.
When I run a composer require drupal/commerce_mollie from a clean install, it installs v1.0 but on my site I'm getting the following:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drupal/commerce_mollie 1.0 -> satisfiable by drupal/commerce_mollie[1.0.0].
    - drupal/commerce_mollie 1.0.0 requires drupal/commerce dev-8.x-2.x -> no matching package found.

This is weird because I've drupal/commerce 2.0 installed.

$composer show drupal/commerce
name     : drupal/commerce
descrip. : Drupal Commerce is a flexible eCommerce solution.
keywords :
versions : * 2.0.0
type     : drupal-module
license  : GPL-2.0+
source   : [git] https://git.drupal.org/project/commerce 8.x-2.0
dist     : [zip] https://ftp.drupal.org/files/projects/commerce-8.x-2.0.zip 8.x-2.0
names    : drupal/commerce

Is this a bug or am I doing something wrong?

Kind regards.

Comments

brahimmouhamou created an issue. See original summary.

ndf’s picture

Status: Active » Needs review

Can you change this line in the composer.json of commerce_mollie:
from: "drupal/commerce": "dev-8.x-2.x",
to: "drupal/commerce": "~2",

Does that help?

brahimmouhamou’s picture

Hey ndf,

When I run composer require drupal/commerce_mollie, version 1.0.0-alpha2 is installed. Changing the composer.json in this commerce_mollie version will not do anything.

I don't understand what you mean, can you clarify?

brahimmouhamou’s picture

I removed my composer.lock file and was able to install commerce_mollie v1.0.
Except from that I think the composer.json file of this module should be updated.

lammensj’s picture

This is indeed something the module maintainer should fix, a patch won't apply here because patching via composer occurs after the calculation of the dependencies. See: https://github.com/cweagans/composer-patches#patches-containing-modifica....

I'm experiencing the same issue and can only install the alpha2 version.

ndf’s picture

Uhmm, still don't get why.
I can reproduce too.
...
Downloaded drupal core from tar file
Ran $ composer install
Ran $ composer require drupal/commerce_mollie

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/commerce_mollie (1.0.0-alpha2): Downloading (100%) 
ndf’s picture

Just ran tests on travis; all green!

https://travis-ci.org/DxEx/commerce_mollie/builds/301464961

I am gonna push this today:
require commerce-2 stable in json
new requirement (because of commerce-2 stable); drupal 8.4.x

ndf’s picture

Title: Can't install stable release » Require Commerce 8.x-2.x stable
Component: Documentation » Code
Category: Support request » Task

  • ndf committed 46aa58b on 8.x-1.x
    #2919395 by brahimmouhamou, ndf, LammensJ: Require Commerce 8.x-2.x...
ndf’s picture

Just create a new release 8.x-1.1
https://www.drupal.org/project/commerce_mollie/releases/8.x-1.1

Still "Needs review", hopefully this works...

lammensj’s picture

Alright, thx! Now we just have to wait until do picks it up :)

lammensj’s picture

In the meantime, I can confirm that the dev-version spawns no dependency-errors. Composer can download it without raising any issues.

lammensj’s picture

The 1.1-version is available. Again, no errors whatsoever.

ndf’s picture

Status: Needs review » Reviewed & tested by the community

It works :)

~/Downloads/drupal-8.4.2 composer require drupal/commerce_mollie
Using version ^1.1 for drupal/commerce_mollie
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 16 installs, 0 updates, 0 removals
  - Installing mollie/mollie-api-php (v1.9.4): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing commerceguys/intl (v0.7.4): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/state_machine (1.0.0-beta3): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/entity (1.0.0-beta1): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/profile (1.0.0-rc1): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/entity_reference_revisions (1.3.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/inline_entity_form (1.0.0-beta1): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing commerceguys/enum (v1.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing commerceguys/addressing (v1.0.0-beta3): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/address (1.2.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/commerce (2.1.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/commerce_mollie (1.1.0): Downloading (100%)         
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
mollie/mollie-api-php suggests installing mollie/oauth2-mollie-php (Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://mollie.com/en/docs for more information.)
commerceguys/addressing suggests installing symfony/intl (to use it as the source of country data)
Writing lock file
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

This one:

> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
  - Installing drupal/commerce_mollie (1.1.0): Downloading (100%)   
ndf’s picture

Thanks guys!

brahimmouhamou’s picture

Alright, composer installs it with ease now! Thanks for fixing!

ndf’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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