I'm using a slightly older version of Laravel and when I do composer install
, I get an error with php artisan package: discover
. Upon examination, I found that composer had changed the format of vendor / composer / installed.json
in version 2.0 and later, causing an error. I'll leave it as a memo because many people are likely to stumble.
php artisan package:discover
production.ERROR: Undefined index: name {"exception":"[object](ErrorException(code: 0): Undefined index: name at /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php:131)
[stacktrace]
#0 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(131): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Undefined index...', '/var/www/php/ve...', 131, Array)
#1 /var/www/php/vendor/laravel/framework/src/Illuminate/Support/Collection.php(685): Illuminate\\Foundation\\PackageManifest->Illuminate\\Foundation\\{closure}(Array, 'packages')
#2 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(132): Illuminate\\Support\\Collection->mapWithKeys(Object(Closure))
#3 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(106): Illuminate\\Foundation\\PackageManifest->build()
#4 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): Illuminate\\Foundation\\PackageManifest->getManifest()
#5 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): Illuminate\\Foundation\\PackageManifest->config('aliases')
#6 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\\Foundation\\PackageManifest->aliases()
#7 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(219): Illuminate\\Foundation\\Bootstrap\\RegisterFacades->bootstrap(Object(Illuminate\\Foundation\\Application))
#8 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(320): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#9 /var/www/php/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#10 /var/www/php/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#11 {main}
"}
--It was specified to install composer with latest --Recently, latest has been changed from 1 series to 2.0.0 --The format of installed.json has changed from composer 2.0.0 --The corresponding Issue has been released in Laravel, but an error occurred because the version was old.
[5.8] Backport support for Composer 2.x #32328 [6.x] Add support for the new composer installed.json format #32310
The error will be resolved by updating to the above version or later. Or use composer 1.x series.
Recommended Posts