作曲家更新最终显示未找到特征'Carbon \ Traits \ Mixin' [英] Composer update ended up saying Trait 'Carbon\Traits\Mixin' not found

查看:50
本文介绍了作曲家更新最终显示未找到特征'Carbon \ Traits \ Mixin'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows机器上安装了带有更高版本PHP(7.2.21)的新XAMPP,并将我的Laravel项目移到了那里.当我在项目根目录中运行composer update时,一切进展顺利,但最后它给出了以下内容:

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?

推荐答案

首先,您应该使用 composer self-update 更新作曲家本身,经常对作曲家进行更新,这样会更好拥有最新版本.

First you should update composer itself with composer self-update, composer is updated frequently and it's better to have the latest version.

然后,您可以尝试删除 vendor/nesbot/carbon 目录并运行 composer clearcache composer update

Then you can try to remove vendor/nesbot/carbon directory and run composer clearcache and composer update

这篇关于作曲家更新最终显示未找到特征'Carbon \ Traits \ Mixin'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆