【问题标题】:Composer: no matching package found作曲家:找不到匹配的包
【发布时间】:2015-09-03 00:05:51
【问题描述】:

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

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.

【问题讨论】:

标签: php github composer-php packagist


【解决方案1】:

问题可能是项目根 composer.json 中定义的最低稳定性(或者如果未定义,则默认为稳定)

由于 bower 存储库尚未发布,您应该:

  1. “VinceG/twitter-bootstrap-wizard”:“@dev”
  2. 定义最低稳定性:“@dev”

请注意,如果您在其他项目中使用此包,您需要在该项目中定义 minimum-stability: "@dev" 或定义 “VinceG/twitter-bootstrap-wizard”:根 composer.json 中的“@dev”

composer 中还有一个选项可让您指定:“prefer-stable”

更多信息: https://igor.io/2013/02/07/composer-stability-flags.html

【讨论】:

    【解决方案2】:

    因为 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 包。

    【讨论】:

      猜你喜欢
      • 2018-04-13
      • 1970-01-01
      • 2015-11-26
      • 2016-04-22
      • 2016-02-29
      • 2017-02-06
      • 1970-01-01
      • 2020-08-16
      • 2021-02-22
      相关资源
      最近更新 更多