如何安装 Laravel 5.8

Han*_*zai 5 php laravel laravel-5.7 laravel-5.8 laravel-6

$ composer create-project --prefer-dist laravel/laravel="5.8.*" larastart
Run Code Online (Sandbox Code Playgroud)

它不起作用,我也尝试了其他一些方法,但对我不起作用

这是我得到的错误:

内容长度不匹配,收到 188377 字节超出预期 620920 repo.packagist.org 无法完全加载,包信息已从本地缓存加载,可能已过期

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

Run Code Online (Sandbox Code Playgroud)

小智 10

你可以试试这个:

composer create-project --prefer-dist laravel/laravel projectName "5.8.*"
Run Code Online (Sandbox Code Playgroud)

对于大多数系统,它需要在 Laravel 版本(例如 5.8.*)上加上双引号。