Composer will not let me install Commerce Core due to "stability" setting?

Created on 18 July 2023, over 1 year ago

Composer Error

Problem 1
- Root composer.json requires drupal/commerce ^2.36 -> satisfiable by drupal/commerce[2.36.0].
- drupal/commerce 2.36.0 requires drupal/inline_entity_form ^1.0@RC -> found drupal/inline_entity_form[dev-1.x, 1.0.0-alpha1, ..., 1.x-dev (alias of dev-1.x)] but it does not match your minimum-stability.

The error you are encountering is related to the minimum stability settings in your Drupal project's composer.json file. Drupal Commerce 2.x requires the drupal/inline_entity_form package, but it seems that your Composer configuration is not allowing the installation of unstable packages (e.g., alpha releases or development branches).

This is on a fresh installation of Drupal 9.5.10

I also find the installation of Drupal Commerce Core to be outdated and also kickstart project. I would love to start using this module and move away from WooCommerce and Shopify

💬 Support request
Status

Active

Version

2.36

Component

Documentation

Created by

🇺🇸United States joedevdrupal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joedevdrupal
  • 🇺🇸United States joedevdrupal

    Is this best practice to do this?

    Allow minimum stability:
    In your project's composer.json file, you can change the "minimum-stability" setting to allow for more unstable packages. To do this, add the following line:

    "minimum-stability": "dev",
    "prefer-stable": true,

    After adding this to your composer.json, run the following command:

    composer require drupal/commerce:2.36.0

  • 🇮🇳India shaika-hassan

    Adjusting the minimum stability in Composer worked for me but it can have consequences, as it may allow the installation of packages in less stable states. However, it's a common practice to set the minimum stability to "dev" in development environments, where you might want to pull in the latest changes and development versions.
    If you're working on a production environment or a more stable release, you might want to consider carefully the stability settings and the potential risks associated with installing less stable versions of packages.
    Setting the minimum stability to "dev" and using "prefer-stable": true in composer.json might resolve the issue you're facing.

  • 🇬🇧United Kingdom Vali Hutchison

    I had the same issue. I resolved it by first installing the latest RC version of drupal/inline_entity_form and then installing Commerce and that worked.

    I didn't need to adjust the "minimum-stability" to do this - so it remained as 'stable'

    For reference here's my composer commands using the latest versions of each as of today:

    composer require 'drupal/inline_entity_form:^3.0@RC'
    composer require 'drupal/commerce:^2.38'
  • 🇳🇬Nigeria ojchris

    I confirm#5 above. Thanks @Vali Hutchison

  • 🇩🇪Germany m Sami Antaki
    $ php -v
    PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)

    $ sudo apt install php8.2-bcmath

    or

    $ composer require 'drupal/commerce:^2.38' --ignore-platform-req=ext-bcmath

  • 🇲🇦Morocco dehcar

    none of the solution provided worked for me
    Fresh windows install
    Fresh Uniform Server Zero with all required Php version and Mariadb
    Fresh composer

    installed Drupal 11 without a problem
    face problem when trying to use the Umami profile, the website throws error 500 and after refresh shows empty/broken

    anyhow delete and reinstalled new drupal 11
    when i tried to install commerce i face this error, that googling it doesn't yield anything meaningful

    C:\server\www\umami>composer require 'drupal/commerce:^3.0@alpha'
    
    In VersionParser.php line 526:
    
      Could not parse version constraint 3.0@alpha': Invalid version string "3.0@alpha'"

    finally what worked for me was switching single quotes to double quotes
    this what worked for me

    composer require "drupal/commerce:^3.0@alpha"

Production build 0.71.5 2024