重新签出后运行“ composer install”时,“未设置Facade根目录”

时间:2019-05-08 19:06:36

标签: php laravel composer-php

我最近有一台新PC,并开始将我的项目开发迁移到该PC。我已经安装了phpcomposergit并将其签出。我运行composer install,它会拉入所有依赖项,但会引发以下错误:

Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
PHP Fatal error:  Uncaught RuntimeException: A facade root has not been set. in /home/user/PhpstormProjects/project/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:234
Stack trace:
#0 /home/user/PhpstormProjects/project/app/Exceptions/Handler.php(61): Illuminate\Support\Facades\Facade::__callStatic('environment', Array)
#1 /home/user/PhpstormProjects/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(353): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 /home/user/PhpstormProjects/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(132): Illuminate\Foundation\Console\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 /home/user/PhpstormProjects/project/artisan(33): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
# in /home/user/PhpstormProjects/project/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 234

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

我尝试删除vendor目录和composer.lock文件,然后重新运行composer install,但是遇到相同的错误。它在我的旧机器上运行良好。我在这里错过了一步吗?

1 个答案:

答案 0 :(得分:0)

在仔细检查日志后,发现这归因于缺少的php7.3-mysql驱动程序。运行sudo apt-get install php7.3-mysql解决了这个问题!