内容长度不匹配,从预期的1478361中接收了 376567 个字节



我最近使用作曲家创建了一个新的Laravel项目。Laravel版本是7.15。

现在,当我尝试安装作曲家laravel/ui软件包时,出现以下错误

Content-Length mismatch, received 376567 bytes out of the expected 1478361
https://repo.packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

我尝试运行composer update命令,但发生了相同的错误。

当我安装laravel时,没有发生此错误。我还没有更新作曲家。

谷歌搜索后,我在Stackoverflow上找到了这个答案, https://stackoverflow.com/a/38635258 但不幸的是,它对我不起作用。

我什至尝试重新安装作曲家,但错误保持不变 (重新安装作曲家过去曾为我工作(

我正在分享我的config.json以及composer.json。

config.json

{
"config": {
"github-protocols": [
"https,ssh"
]
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.org"
}
}
}

作曲家.json

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}

composer diagnose输出

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E57DC31 7ECC7CC5 573890D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC0265 2F0C1167 CBBC8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.10.7
PHP version: 7.4.1
PHP binary path: C:xamppphpphp.exe
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019

请帮助我,没有作曲家,我无法继续我的Laravel项目。

看来他们在《亚洲镜报》上遇到了带宽问题。 查看此问题的评论#5。

作曲家更新不起作用

我遇到了同样的问题,我通过运行这两个命令解决了它

$ composer config -g repo.packagist composer https://packagist.org
$ composer config -g github-protocols https ssh

相关内容

  • 没有找到相关文章

最新更新