5

Is anyone getting this when running a composer update command?

Local install: Craft CMS 3.1.31

update --no-interaction --ansi
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Nothing to install or update
    Generating optimized autoload files
    Carbon 1 is deprecated, see how to migrate to Carbon 2.
    https://carbon.nesbot.com/docs/#api-carbon-2
        You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
    All packages for ./composer.json have been updated.
6

To find the culprit, you could run a composer show --tree to see which plugin is using the dependency.

So far, I found two plugins using it :

  • rias/craft-contact-form-extensions (1.1.6)
  • solspace/craft3-calendar (2.0.20)

If you're using Solspace calendar, you should consider to upgrade to v3. If you're using Rias Contact form extension, you can try to add the updated dependency to your composer.json file by running a composer require nesbot/carbon. It will fix the warning until the plugin is updated.

| improve this answer | |
5

All Solspace plugins use some bit of the Carbon dependency so it's highly likely it might be something like Calendar and/or Freeform triggering this. As of last week, we've updated Freeform 2, Freeform 3 and Express Forms to use ^1.22.1|^2.19 for the requirement, and Calendar will receive the same update this week.

The issue is that Carbon 2 requires PHP 7.1.8+ while Craft 3 requires PHP 7.0+. Carbon 1.x was recently deprecated, but by no means is it unsafe, unstable or risky to use, etc. If we changed it to force Carbon 2, anyone using PHP 7.0 wouldn't be able to use Freeform/Calendar, etc, so we've switched it to ^1.22.1|^2.19 as noted above, meaning that if your site happens to have PHP 7.1.8+ installed, it'll pull the 2.x version of Carbon instead, and you will no longer see the error.

If you happen to have PHP 7.0.x installed on your server, however, it'll always call Carbon 1 and always trigger the error, since there currently is no available version of Carbon that supports PHP 7.0 and is not deprecated.

| improve this answer | |
  • Hello. I have this same Carbon 1 error, and I am running php 7.3.11. Is not enought to run Carbon 2 ? – Gfra54 Feb 20 at 10:02
  • 1
    It might be that another plugin is using Carbon 1, and therefore forces Freeform/Calendar to use it as well. But we'd need to know more information before speculating further. :) – Solspace Feb 21 at 15:29
2

One of the plugins you have installed is either directly including a Carbon 1 dependency (or indirectly via one of its dependencies).

Whatever is doing it should eventually update to using Carbon 2.

| improve this answer | |
2

Thank you both - It's Freeform 3 (Solspace notified)

enter image description here

| improve this answer | |
1

require add "kylekatarnls/laravel-carbon-2": "^1.0.0", "nesbot/carbon": "2.0.0-beta.2 as 1.25.0"

composer update

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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