内容长度不匹配,从预期的 1478361 中接收到 376567 个字节
Content-Length mismatch, received 376567 bytes out of the expected 1478361
我最近使用 Composer 创建了新的 Laravel 项目。 Laravel 版本是 7.15.
现在当我尝试安装 composer 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 时没有出现这个错误。我还没有更新作曲家。
谷歌搜索后,我在 Whosebug 上找到了这个答案,
但不幸的是,它对我不起作用。
我什至尝试重新安装作曲家,但错误仍然存在
(重新安装作曲家过去对我有用)
我正在分享我的 config.json 以及 composer.json。
config.json
{
"config": {
"github-protocols": [
"https,ssh"
]
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.org"
}
}
}
composer.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:\xampp\php\php.exe
OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019
请帮助我,没有 composer 我无法继续我的 Laravel 项目。
Asia Mirror 的带宽似乎有问题。
查看本期的评论 #5。
我遇到了同样的问题,我通过运行这两个命令解决了
$ composer config -g repo.packagist composer https://packagist.org
$ composer config -g github-protocols https ssh
我最近使用 Composer 创建了新的 Laravel 项目。 Laravel 版本是 7.15.
现在当我尝试安装 composer 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 时没有出现这个错误。我还没有更新作曲家。
谷歌搜索后,我在 Whosebug 上找到了这个答案,
我什至尝试重新安装作曲家,但错误仍然存在 (重新安装作曲家过去对我有用)
我正在分享我的 config.json 以及 composer.json。
config.json
{
"config": {
"github-protocols": [
"https,ssh"
]
},
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.org"
}
}
}
composer.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:\xampp\php\php.exe
OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019
请帮助我,没有 composer 我无法继续我的 Laravel 项目。
Asia Mirror 的带宽似乎有问题。 查看本期的评论 #5。
我遇到了同样的问题,我通过运行这两个命令解决了
$ composer config -g repo.packagist composer https://packagist.org
$ composer config -g github-protocols https ssh