Laravel项目安装失败

1、安装项目出现的问题
# 问题代码:
D:\PHPSTUDY\PHPTutorial\WWW\LaravelStudy20211215>composer create-project laravel/laravel=7.25.0 --prefer-dist ./
Creating a "laravel/laravel=7.25.0" project at "./"
https://repo.packagist.org could not be fully loaded (curl error 28 while downloading https://repo.packagist.org/packages.json: Operation timed out after 10005 milliseconds with 0 out of 0 bytes received), package information was loaded from the local cache and may be out of date


  [Composer\Downloader\TransportException]
  curl error 28 while downloading https://repo.packagist.org/p2/laravel/laravel.json: Operation timed out after 30001
  0 milliseconds with 0 out of 8447 bytes received


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package>] [<directory>] [<version>]
 

解决方式:

# 连续运行以下的三行代码之后再重新创建Laravel项目就成功了
composer config -l -g
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer config -g --unset repos.packagist
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值