Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel PackageManifest.php: Undefined index: name

Tags:

php

laravel

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?

like image 318
arety_ Avatar asked Apr 12 '20 20:04

arety_


People also ask

How do I fix Undefined index name in laravel?

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.

What is undefined index in laravel?

That means the PHP code tries to get the value of the field that no one has defined and thus does not exist.


Video Answer


1 Answers

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; 
like image 149
Pulkit Modi Avatar answered Oct 11 '22 03:10

Pulkit Modi