Composer update ended up saying Trait 'Carbon\Traits\Mixin' not found

眉间皱痕 提交于 2021-02-10 14:14:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!