问题
I installed a new XAMPP with a higher version of PHP (7.2.21) on my windows machine and moved my Laravel project there. When I ran composer update in my project root everything went well but at the end it gave the following:
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In Macro.php line 33:
Trait 'Carbon\Traits\Mixin' not found
PHP Fatal error: Trait 'Carbon\Traits\Mixin' not found in D:\xampp\htdocs\myproject\vendor\nesbot\carbon\src\Carbon\Traits\Macro.php on line 33
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
I googled the error but found really nothing about this. What am I missing?
回答1:
First you should update composer itself with composer self-update
, composer is updated frequently and it's better to have the latest version.
Then you can try to remove vendor/nesbot/carbon
directory and run composer clearcache
and composer update
来源:https://stackoverflow.com/questions/57612203/composer-update-ended-up-saying-trait-carbon-traits-mixin-not-found