briannesbitt / Carbon

A simple PHP API extension for DateTime.
https://carbon.nesbot.com/
MIT License
16.54k stars 1.28k forks source link

Carbon 2 is not updating #1781

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

I encountered an issue when updating Carbon 1 => 2. I am using Craft CMS 3, and when I update the composer, a deprecation errors states that i should update Carbon 1 to Carbon 2.

This is the message:

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.

I tried to run the command, got a message to confirm the update, confirmed it, but composer tells me that nothing to install or update. Is there anyway I can update it ?

Carbon version: 1.39.0

PHP version: 7.1.10

Thanks!

kylekatarnls commented 5 years ago

Hi,

It probably means that an other dependency is locking Carbon to ^1. Please show us your composer.json require and require-dev sections. If it changes before/after the command, please show both. And dump the composer output.

Thanks.

kylekatarnls commented 5 years ago

I tried a simple install with just the last version of Craft CMS 3 and Carbon 1.39, then ran the upgrade-script. It worked fine. So there is no restriction in Craft CMS 3 itself, I need more details to reproduce your issue.

kylekatarnls commented 5 years ago

I assume you found the package requiring Carbon < 2 in your dependencies. So I close the issue. If you still have the issue, please provide requested details above and I will re-open.

akanshutambi811 commented 4 years ago

Hello,

I encountered an issue when updating Carbon 1 => 2. I am using Craft CMS 3, and when I update the composer, a deprecation errors states that i should update Carbon 1 to Carbon 2.

This is the message:

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.

I tried to run the command, got a message to confirm the update, confirmed it, but composer tells me that nothing to install or update. Is there anyway I can update it ?

akanshutambi811 commented 4 years ago

My composer File

{ "require": { "craftcms/cms": "3.0.41.1", "craftcms/redactor": "2.1.7", "dolphiq/craft3-forms": "1.1.0", "ether/seo": "3.4.4", "ether/simplemap": "3.3.5", "solspace/craft-freeform": "2.5.26", "spicyweb/craft-neo": "2.1.8", "studioespresso/craft-easyaddressfield": "1.4.0", "twig/twig": "2.6.*", "verbb/cp-nav": "2.0.9", "verbb/navigation": "1.1.8", "vlucas/phpdotenv": "^2.4.0", "cebe/markdown": "~1.1.0", "xpertbot/craft-wheelform": "2.2.4" }, "autoload": { "psr-4": { "modules\": "modules/" } }, "config": { "sort-packages": true, "optimize-autoloader": true, "platform": { "php": "7.0" } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ] },

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

}

kylekatarnls commented 4 years ago

Please run the command composer why nesbot/carbon to see what packages are requiring Carbon 1.x, one of them probably does not accept Carbon 2.

If so, you can either falsify the version number using composer alias (see the main page of the doc https://carbon.nesbot.com/). It's not ideal, because it disallow you to install new packages that require Carbon 2 but do not support Carbon 1.

Or the better solution: contact owners of the packages that "lock" Carbon to its old version to ask them to support the new major version in their compatibility range.