Amatul Uzma
Amatul Uzma

Reputation: 29

PackageManifest.php line 131 Undefined index:name after trying to install a package

I was working with laravel 6 version. I tried to install mpdf package to create a "pdf download" option. I used composer require carlos-meneses/laravel-mpdf command. It didn't install the package and gave me this message

PackageManifest.php line 131 Undefined index:name

I had the same experience with installation of dompdf.

enter image description here

Upvotes: 1

Views: 5334

Answers (1)

Netwons
Netwons

Reputation: 1648

this page

vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php this line comment :

$packages = json_decode($this->files->get($path), true);

Add two lines:

$installed = json_decode($this->files->get($path), true);
$packages = $installed['packages'] ?? $installed;

Upvotes: 8

Related Questions