Composer下载Laraveld遇到的错误:error 60..28等等

Composer下载Laravel遇到的坑

composer global require laravel/installer

1.curl erroe 60错误

"repositories": {
        "packagist": {
            "type": "composer",
            "url": "https://packagist.laravel-china.org"
        }
    }

替换为

"repositories": {
        "packagist": {
            "type": "composer",
            "url": "https://mirrors.aliyun.com/composer/"
        }
    }

在这里插入图片描述

2.curl error 28 错误

按网上的解决办法是更改镜像位置:

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

但是这个更改方法与上述无异,但还是会在下载中出现:

Failed to download symfony/console from dist: curl error 28 while downloading https://api.github.com

这个是单项下载中出现的问题,最后使用科学上网,install多几次就成功下载

3.git报错问题——下载最后红色框出现

1) CAfile: C:\EXE\Git\mingw64\sslcert.pem CApath: none

很明显这个是路径没有找到,不难看出是路径上少了个’’

首先进入:.gitconfig

直接在cmd终端或者git bash中输入

git config --gobal --edit

直接打开vsc中便可直接修改,再次运行便没有出现错误

.gitconfig

[core]
	editor = \"C:\\vscode\\Microsoft VS Code\\bin\\code\" --wait
[http]
	postBuffer = 524288000
	sslVerify = true
	sslBackend = openssl
	#以下源代码为:"sslCAInfo = C:\\EXE\\Git\\mingw64\\sslcert.pem"
	sslCAInfo = C:\\EXE\\Git\\mingw64\\ssl\\cert.pem
[remote "origin"]
	proxy = 

2)Cloning into… fatal: unable to access… error setting certificate verify locations:

这个应该是证书验证错误,推荐方法

1.暴力解决-直接取消认证
git config --global http.sslverify "false"
2.指定证书的路径-根据错误提示的CAfile信息加载证书路径
sudo git config --system http.sslCAinfo ***.crt

3)Failed to connect to github.com port 443 after 21098 ms: Timed out

原因: 这样的问题往往是由于网络慢访问超时,这时候我们可以在终端选择使用设置代理和取消代理的命令解决。

设置代理:

git config --global https.proxy

取消代理:

git config --global --unset https.proxy

4.Cloning failed using an ssh key for authentication, enter your GitHub credentials

Token(hidden):

首先到https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+服务器名称+2018-07-08+0803这个地址重新生成一下token

点击最下方的:

在这里插入图片描述

在这里插入图片描述

复制就好,接着打开 C:\Users\***\AppData\Roaming\Composer\auth.json

{
    "bitbucket-oauth": {},
    "github-oauth": {
        // 在这里输入token值
        "github.com": "ghp_q**************"
    },
    "gitlab-oauth": {},
    "gitlab-token": {},
    "http-basic": {
    },
    "bearer": {}
}

或者直接再终端输入:

在这里插入图片描述

5.Composer:Failed to execute git clone --mirror

composer install时,composer存在非开源依赖,账号无权限等

此问题可能存在的原因:

ssh设置的已经被踢除,请替换正确的
composer依赖中设定了指定的账号密码

解决办法:

打开 C:\Users***\AppData\Roaming\Composer\auth.json

{
    "bitbucket-oauth": {},
    "github-oauth": {
     // 在这里输入token值
        "github.com": "ghp_****************"
    },
    "gitlab-oauth": {},
    "gitlab-token": {},
    "http-basic": {
        "gitlab.com.cn": {
            "username": "diary*",
            "password": "***********"
        }
    },
    "bearer": {}
}

在这里插入图片描述


最终也是黄天不负有心人,成功安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值