1

I am just upgrading my clients site and have upgraded all plugins including commerce-stripe up to v3.1.1. I want to upgrade to v4.0.0 for commerce-stripe but keep getting the following message - does anyone know what i need to do?

~$ composer update
You made a reference to a non-existent script @pre-craft-update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires craftcms/commerce-stripe 4.0.0 -> satisfiable by craftcms/commerce-stripe[4.0.0].
    - You can only install one version of a package, so only one of these can be installed: stripe/stripe-php[v7.0.0, ..., v7.128.0, v8.0.0, ..., v8.12.0, v9.0.0, ..., v9.9.0, v10.0.0, ..., v10.21.0].
    - enupal/stripe[5.1.1, ..., 5.3.1] require stripe/stripe-php ^7.0 -> satisfiable by stripe/stripe-php[v7.0.0, ..., v7.128.0].
    - craftcms/commerce-stripe 4.0.0 requires stripe/stripe-php ^10.0 -> satisfiable by stripe/stripe-php[v10.0.0, ..., v10.21.0].
    - Root composer.json requires enupal/stripe ^5.1.1 -> satisfiable by enupal/stripe[5.1.1, ..., 5.3.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

1 Answer 1

2

Read the error messages line by line, then it becomes clear what the problem is.

- Root composer.json requires craftcms/commerce-stripe 4.0.0 -> satisfiable by craftcms/commerce-stripe[4.0.0].
[...]
- Root composer.json requires enupal/stripe ^5.1.1 -> satisfiable by enupal/stripe[5.1.1, ..., 5.3.1].

This tells you have both the craftcms/commerce-stripe and the enupal/stripe package as direct dependencies in your project, because you have both of those plugins installed.

- enupal/stripe[5.1.1, ..., 5.3.1] require stripe/stripe-php ^7.0 -> satisfiable by stripe/stripe-php[v7.0.0, ..., v7.128.0].

One of those plugins requires the package stripe/stripe-php in version 7.x …

- craftcms/commerce-stripe 4.0.0 requires stripe/stripe-php ^10.0 -> satisfiable by stripe/stripe-php[v10.0.0, ..., v10.21.0].

… but the other plugin requires the same package in version 10.x.

You can only have one version of a package installed at the same time. But both plugins require different versions of the stripe/stripe-php package, so it's impossible for Composer to select one version that fits both requirements.

Therefore you get this:

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

To resolve this, you have some options:

  • Ask the maintainer of the enupal/stripe plugin to update their plugin to support version 10.x of the package.
  • Ask the maintainer of the craftcms/commerce-stripe plugin to support older versions of that package, including 7.x.
  • Fork either plugin and update it yourself to support one of those versions.
  • Uninstall one of the plugins.
1
  • 1
    Thanks for the great detailed answer - much appreciated Commented Sep 21, 2023 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.