manifest php,Laravel PackageManifest.php: Undefined index: name

问题

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?

回答1:

i had the same problem.

In my case downgrading the composer version fixed the problem.

They updated Composer 4 times within 2 days - i think they had a problem with their newest updates.

In my case version 1.10.1 was the version to go with.

I hope it'll work.

回答2:

Try this, it is worked for me, in following file:

vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php

Find this line and comment it

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

Add two new lines after above commented line

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

$packages = $installed['packages'] ?? $installed;

回答3:

I found this issue on the composer git-hub server that helped a lot:

https://github.com/composer/composer/issues/9340

I updated my Laravel framework from 5.8 to 5.8.38, following the table displayed in that issue and the error disappeared.

This blog also helps: https://blog.laravel.com/upgrading-to-composer-v2

If you can't upgrade Laravel, you can just stay with Composer 1 by running composer self-update --1

回答4:

I had a problem like this, and also tried composer self-update --stable, but there was no result. So, I found that this file belongs to the Laravel framework. So the following command resolved this issue:

$ composer update laravel/framework

回答5:

Running the following command fixed it for us

composer self-update --stable

回答6:

In my case downgrading the composer version fixed the problem.

sudo composer self-update --1

来源:https://stackoverflow.com/questions/61177995/laravel-packagemanifest-php-undefined-index-name

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值