Laravel, composer install causes an error in PackageManifest, so resolve it

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.

Error and stack trace

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}
"} 

Cause

--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.

Corresponding Issue

[5.8] Backport support for Composer 2.x #32328 [6.x] Add support for the new composer installed.json format #32310

Fixed version of Laravel

Solutions

The error will be resolved by updating to the above version or later. Or use composer 1.x series.

Recommended Posts

Laravel, composer install causes an error in PackageManifest, so resolve it
composer install error
After setting database to mysql, bundle install causes an error
When [command not found: composer] is displayed when [composer install] is displayed in Laravel
I don't see an error in Rails bundle install ... the solution
Install laravel/Dusk in docker environment (laravel6)
Error summary in bundle install. memorandum
What to do and how to install when an error occurs in DXRuby 1.4.7