【发布时间】:2021-11-20 08:34:16
【问题描述】:
当我为 laravel 创建一个新的作曲家项目时
composer create-project laravel/laravel laravel
我收到以下错误
> @php artisan package:discover --ansi
Error
Class 'Symfony\Component\Translation\Loader\ArrayLoader' not found
at vendor/nesbot/carbon/src/Carbon/Translator.php:80
76▕ public function __construct($locale, Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false)
77▕ {
78▕ $this->initializing = true;
79▕ $this->directories = [__DIR__.'/Lang'];
➜ 80▕ $this->addLoader('array', new Translation\Loader\ArrayLoader());
81▕ parent::__construct($locale, $formatter, $cacheDir, $debug);
82▕ $this->initializing = false;
83▕ }
84▕
+13 vendor frames
14 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
+5 vendor frames
20 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
我使用最新的稳定作曲家 (2.1.8) 在 PHP 7.4.24 docker 容器 (macOS) 中运行它。
【问题讨论】:
-
这能回答你的问题吗? Corrupted composer.json file in Laravel 8
-
这是最近几个小时内修复的错误。您可以尝试再次运行您的命令吗?
标签: php laravel symfony composer-php