I'm just trying to deploy my application and I just ran composer update on my server and I got the following error:
In PackageManifest.php line 122: Undefined index: name
How can I fix this issue?
Undefined index: name The new version of composer has a different format for `installed. json` and autodiscovery needs to be updated. If you can't update Laravel for whatever reason, you can roll back your Composer version to 1 by running composer self-update --1 . That will revert the installed.
That means the PHP code tries to get the value of the field that no one has defined and thus does not exist.
As a temporary fix, try this, it worked for me, in the following file:
vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php
Find line 116 and comment it:
$packages = json_decode($this->files->get($path), true);
Add two new lines after the above commented line:
$installed = json_decode($this->files->get($path), true); $packages = $installed['packages'] ?? $installed;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With