我正在关注 Laravel 6.x 到 Laravel 7.x 升级文档并进行了必要的更改。但它失败并显示以下错误。在运行composer update
时没有第 3 方包。然后我安装了一些其他软件包,然后尝试再次更新并陷入此错误。
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given, called in phar:///usr/local/bin/composer/src/Composer/Util/ProcessExecutor.php on line 65 and defined in /var/www/html/laravel/laravel-starter/vendor/symfony/process/Process.php:140
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Util/ProcessExecutor.php(65): Symfony\Component\Process\Process->__construct(''/usr/bin/php7....', NULL, NULL, NULL, 300)
#1 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(245): Composer\Util\ProcessExecutor->execute(''/usr/bin/php7....')
#2 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#3 phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php(312): Composer\EventDispatcher\EventDispatcher->dispatchScript('post-autoload-d...', true, Array, Array)
#4 phar:///usr/local/bin in /var/www/html/laravel/laravel-starter/vendor/symfony/process/Process.php on line 140
Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Process\Process::__construct() must be of the type array, string given, called in phar:///usr/local/bin/composer/src/Composer/Util/ProcessExecutor.php on line 65 and defined in /var/www/html/laravel/laravel-starter/vendor/symfony/process/Process.php:140
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Util/ProcessExecutor.php(65): Symfony\Component\Process\Process->__construct(''/usr/bin/php7....', NULL, NULL, NULL, 300)
#1 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(245): Composer\Util\ProcessExecutor->execute(''/usr/bin/php7....')
#2 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#3 phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php(312): Composer\EventDispatcher\EventDispatcher->dispatchScript('post-autoload-d...', true, Array, Array)
#4 phar:///usr/local/bin in /var/www/html/laravel/laravel-starter/vendor/symfony/process/Process.php on line 140
该项目的源代码位于:https ://github.com/nasirkhan/laravel-starter/tree/v7