Composer - 添加没有composer.json的git存储库

Son*_*que 12 git composer-php

我尝试从GitHub添加存储库(designmodo /镶UI),具有配置玩,得到错误No valid composer.json was found in any branch or...,Your requirements could not be resolved to an installable set of packages.,The requested package designmodo/flat-ui could not be found in any version

我在配置中犯了什么错误:

"repositories": {
   "flat-ui": {
     "type": "package",
     "package": {
       "name": "designmodo/Flat-UI", 
       "version": "1.3.0", // Don't know is it important? Where get this number in repo?
       "source": {
         "url": "https://github.com/designmodo/Flat-UI",
         "type": "git",
         "reference": "dev-master" // reference is branch name? 
       }
     }
   }
 },

 "require": {
   "twbs/bootstrap-sass": "~3.2",
   "designmodo/Flat-UI": "dev-master" // branch again (/minimum-stability?)
 },
Run Code Online (Sandbox Code Playgroud)

在某些时候作曲家下载包但返回错误(我不知道他什么时候做,我查找供应商文件夹和designmodo文件夹就在那里).

Son*_*que 13

问题解决了.玩和改变reference,以master和版本,以任何*"designmodo/Flat-UI": "*"部分.之后,作曲家通过git下载包并更新composer.lock没有问题.应该适用于任何github回购.

工作配置:

{
    "repositories": {
      "flat-ui": {
        "type": "package",
        "package": {
          "name": "designmodo/Flat-UI",
          "version": "1.3.0",
          "source": {
            "url": "https://github.com/designmodo/Flat-UI",
            "type": "git",
            "reference": "master"
          }
        }
      }
    },
    "require": {
        "twbs/bootstrap-sass": "~3.2",
        "designmodo/Flat-UI": "*"
    },
}
Run Code Online (Sandbox Code Playgroud)

https://getcomposer.org/doc/05-repositories.md


Pab*_*eco 7

它只能帮我删除标签,如下所示:

{
        "repositories":[
        {              
            "type": "package",
            "package": {
              "name": "designmodo/Flat-UI",
              "version": "1.3.0",
              "source": {
                "url": "https://github.com/designmodo/Flat-UI",
                "type": "git",
                "reference": "master"
              }
            }
        }
        ],
        "require": {
            "twbs/bootstrap-sass": "~3.2",
            "designmodo/Flat-UI": "*"
        }, 
}
Run Code Online (Sandbox Code Playgroud)