php - Composer : no matching package found

标签 php github composer-php packagist

我创建了一个正在开发中的小部件。问题是当我运行时:

composer require chofoteddy/yii2-bootstrap-wizard "*"

我收到以下消息:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for chofoteddy/yii2-bootstrap-wizard * -> satisfiable by chofoteddy/yii2-bootstrap-wizard[dev-master].
    - chofoteddy/yii2-bootstrap-wizard dev-master requires vinceg/twitter-bootstrap-wizard * -> no matching package found.

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.

Installation failed, reverting ./composer.json to its original content.

我寻求的是添加 https://github.com/VinceG/twitter-bootstrap-wizard.git存储库作为我项目的依赖项。 “VinceG/twitter-bootstrap-wizard”未在“Packagist”中注册。

我修改了很多次我的 composer.json 文件,为了更正它,但我不能让它工作。

我的文件 composer.json:

{
    "name": "chofoteddy/yii2-bootstrap-wizard",
    "description": "Wizard form based on twitter bootstrap plugin (@VinceG)",
    "homepage": "https://github.com/Chofoteddy/yii2-bootstrap-wizard",
    "keywords": [
        "yii2",
        "wizard",
        "bootstrap",
        "yii2-extension"
    ],
    "type": "yii2-extension",
    "version": "0.1",
    "license": "MIT",
    "authors": [
        {
            "name": "Christopher",
            "email": "chofoteddy88@yahoo.com.mx"
        }
    ],
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "VinceG/twitter-bootstrap-wizard": "*"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/VinceG/twitter-bootstrap-wizard"
        }
    ],
    "autoload": {
        "psr-4": {
            "chofoteddy\\wizard\\": ""
        }
    }
}

作曲者信息:

sudo composer self-update
You are already using composer version b2173d28fc8b56236eddc8aa10dcda61471633ec.

最佳答案

因为 VinceG/twitter-bootstrap-wizard 不是 Composer 包(它不包含 composer.json)所以你必须在你的 中定义它composer.json

您的存储库部分应如下所示:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "VinceG/twitter-bootstrap-wizard",
            "version": "1.2",
            "dist": {
                "url": "https://github.com/VinceG/twitter-bootstrap-wizard/archive/1.2.zip",
                "type": "zip"
            },
            "source": {
                "url": "https://github.com/VinceG/twitter-bootstrap-wizard.git",
                "type": "git",
                "reference": "1.2"
            }
        }
    }
],

您也可以看看 component-installercomposer-asset-plugin在 composer 中管理组件和 bower 包。

关于php - Composer : no matching package found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30896930/

相关文章:

php - 如何使用单个查询从两个表中选择数据

Git:意外地将冲突注释 merge 到分支中。我该如何删除它们?

symfony - 如何使用从composer安装的phpunit?

php - SQL 语句在 PHP 中不起作用,但在 MySQL 中起作用

php - symfony2 获取路由参数( Controller 参数与请求)

php - Woocommerce session : woocommerce_get_cart_item_from_session

git - 无法推送到远程 repo - "Please make sure you have the correct access rights and the repository exists."

git - 致命的 : The remote end hung up unexpectedly with a fetch upstream

php - Docker 从容器内部复制 Composer 供应商

laravel-5 - 使用 composer 在 Laravel 5 中设置 Zurb Foundation 6 (sass)