使用 composer 安装 yii2 的坑-github授权

所报错误:

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

问题描述

执行安装 yii2 的时候
composer create-project yiisoft/yii2-app-advanced yii2-advanced

解决方法

编辑 composer.json

vim composer.json

然后添加 github 授权码

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

获取 github 授权码

  • 点击 https://github.com/settings/tokens
  • 点击右上角 Generate new token
  • 在Token description中输入"可以任意"
  • 点击Generate token即可创建新的github授权码

发表评论