1. 程式人生 > >yii2使用composer安裝出錯,github授權問題

yii2使用composer安裝出錯,github授權問題

終端所報的錯誤:

➜ 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

==== 轉載請說明原文出處