yii2使用composer安装出错,github授权问题

2018-06-22 05:21:37来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

=====================================================

==== 原文链接:http://www.cnblogs.com/Hzhihua/p/7064976.html

==== 转载请说明原文出处

=====================================================

 

最近在学习yii2.0  一直想用官方推荐的composer来安装  一直不成功  报了一个错误一直在困扰着我

废话少说  直入主题

终端所报的错误:

? Yii2.0 composer create-project yiisoft/yii2-app-advanced yii2-advanced --prefer-dist
Installing yiisoft/yii2-app-advanced (2.0.12)
- Installing yiisoft/yii2-app-advanced (2.0.12): Downloading (100%)
Created project in yii2-advanced
Loading composer repositories with package information
Updating dependencies (including require-dev)


[Composer\Repository\InvalidRepositoryException]
No valid bower.json was found in any branch or tag of https://github.com/bestiejs/punycode.js.git, could not load a package from it.

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

问题描述:

在终端输入

composer create-project yiisoft/yii2-app-advanced yii2-advanced --prefer-dist

之后就出现了这个错误。。。。

解决办法:

目前我发现解决这个问题的办法是:

直接编辑yii2-advanced文件夹composer.json文件

vi yii2-advanced/composer.json

然后添加github的授权

"config": {
        "process-timeout": 1800
    },

改为

"config": {
        "process-timeout": 1800,
        "github-oauth": {
          "github.com": "此处输入您的github授权码"
          }
    },

保存文件,运行以下命令即可完成yii2框架的导入

cd yii2-advanced
composer update

如何获取github的授权码??

https://github.com/settings/tokens

点击此链接  -->  点击右上角Generate new token  --> 在Token description中输入"yii composer install token"  

-->  点击Generate token即可创建新的github授权码

Token description中可以随意输入描述

 

 

=====================================================

==== 原文链接:http://www.cnblogs.com/Hzhihua/p/7064976.html

==== 转载请说明原文出处

=====================================================

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:JQuery控制下拉列表

下一篇:laravel5.4学习笔记