【问题标题】:Can't install forked github repository via composer无法通过 composer 安装分叉的 github 存储库
【发布时间】:2015-12-23 13:22:25
【问题描述】:

我从 Github 上的存储库创建了一个分支,并希望将其安装到我的项目中。我有以下composer.json

{
    "repositories": [
        {   
            "url": "https://github.com/guidobr/instagram-api",
            "type": "git"
        }   
    ],  
    "require": {
        "guidobr/instagram-api": "*" 
    }   
}

当我尝试安装它时,我得到了这个响应:

Loading composer repositories with package information
Installing dependencies (including require-dev)       
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package guidobr/instagram-api could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

我做错了什么?尝试了该链接中的所有解决方案,但都没有成功。

【问题讨论】:

    标签: php github composer-php


    【解决方案1】:

    你分叉了 repo,但你没有在 packagist 中创建包。

    如果您检查此文件https://github.com/GuidoBR/instagram-api/blob/master/composer.json,它仍在使用 cosenary/instagram。

    所以转到 http://www.packagist.com/ 并创建一个新的包,它需要有新的 composer.json 文件。

    【讨论】:

    • 这是一个怎样的解决方案... 使用 VCS 选项,它应该可以在没有打包师的情况下工作。这就是“存储库”字段的用途。
    猜你喜欢
    • 2018-10-04
    • 2019-11-21
    • 1970-01-01
    • 2016-05-11
    • 2014-06-09
    • 2020-05-08
    • 1970-01-01
    • 1970-01-01
    • 2023-01-30
    相关资源
    最近更新 更多