[InvalidArgumentException] Could not find package laravel/laravel with version 5.6.*.,laravel部署报错解决

用composer部署laravel框架时,需要先保证已经安装composer成功,如下图所示:

 

这是在 composer 安装laravel框架时,出现的报错如下:

O:\phpstudy_new\PHPTutorial\WWW>composer create-project laravel/laravel=5.6.* laravel --prefer-dist
Creating a "laravel/laravel=5.6.*" project at "./laravel"


  [InvalidArgumentException]
  Could not find package laravel/laravel with version 5.6.*.


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

Could not find package laravel/laravel with version 5.6.*.,不能找到包,说明是下载的镜像地址问题。从而导致无法找到框架包。

解决方案如下:

切换composer的镜像地址为阿里云镜像,

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

然后再去部署laravel项目:

composer create-project --prefer-dist laravel/laravel bbs "5.6.*"

--prefer-dist 是去下载压缩包,避免源码下载,上传速度慢等现象。

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值