Composer - adding git repository without composer.json

后端 未结 2 866
说谎
说谎 2021-02-04 07:24

I try to add repository from github (designmodo/Flat-UI), play with config and get errors No valid composer.json was found in any branch or..., Your requireme

2条回答
  •  北海茫月
    2021-02-04 08:17

    Problem solved. Play around and changed reference to master and version to any * in "designmodo/Flat-UI": "*" section. After that composer download package via git and update composer.lock without problems. Should work for any github repos.

    Working config:

    {
        "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": "*"
        },
    }
    

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

提交回复
热议问题