【发布时间】:2020-05-21 16:19:06
【问题描述】:
$ composer create-project --prefer-dist laravel/laravel="5.8.*" larastart
它不起作用,我也尝试了其他一些方法,但对我不起作用
这是我得到的错误:
Content-Length 不匹配,从预期的 620920 repo.packagist.org 中收到 188377 字节,无法完全加载,包信息是从本地缓存加载的,可能已过期
OS Name Microsoft Windows 10 Home Single Language
Version 10.0.18363 Build 18363
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Name DESKTOP-7CV9HTK
System Manufacturer HP
System Model HP ENVY Laptop 13-ah1xxx
System Type x64-based PC
System SKU 5HZ05PA#AKL
Processor Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz, 1992 Mhz, 4 Core(s), 8 Logical Processor(s)
BIOS Version/Date Insyde F.12, 11/8/2018
SMBIOS Version 3.0
Embedded Controller Version 69.72
BIOS Mode UEFI
BaseBoard Manufacturer HP
BaseBoard Product 850B
BaseBoard Version 69.72
Platform Role Mobile
Secure Boot State On
PCR7 Configuration Elevation Required to View
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume2
Locale United States
Hardware Abstraction Layer Version = "10.0.18362.387"
User Name DESKTOP-7CV9HTK\Hanifullah Jamalzai
Time Zone Afghanistan Standard Time
Installed Physical Memory (RAM) 16.0 GB
Total Physical Memory 15.8 GB
Available Physical Memory 9.89 GB
Total Virtual Memory 18.2 GB
Available Virtual Memory 10.3 GB
Page File Space 2.38 GB
Page File C:\pagefile.sys
Kernel DMA Protection Off
Virtualization-based security Not enabled
Device Encryption Support Elevation Required to View
Hyper-V - VM Monitor Mode Extensions Yes
Hyper-V - Second Level Address Translation Extensions Yes
Hyper-V - Virtualization Enabled in Firmware Yes
Hyper-V - Data Execution Protection Yes
【问题讨论】:
-
使用
composer create-project --prefer-dist laravel/laravel larastart并检查安装的是哪个版本? -
显示此错误并且未安装任何版本的 laravel:内容长度不匹配,收到 188377 字节超出预期的 620920 repo.packagist.org 无法完全加载,包信息是从本地加载的缓存,可能已经过时了
-
首先,检查PHP的版本应该是PHP>=7.1.3。然后运行这些命令:首先,composer global require laravel/installer,其次,composer create-project --prefer-dist laravel/laravel larastart "5.8.*"。这里是 laravel 安装文档:laravel.com/docs/5.8/installation
-
这个答案为我解决了这个问题。更改您的包 url 以使用 https。 stackoverflow.com/a/52002960/909973
-
这能回答你的问题吗? Composer Content-Length Mismatch
标签: php laravel laravel-5.8 laravel-5.7 laravel-6