首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Composer:找不到匹配的包

Composer:找不到匹配的包
EN

Stack Overflow用户
提问于 2015-06-18 00:11:29
回答 2查看 2.8K关注 0票数 3

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

代码语言:javascript
复制
composer require chofoteddy/yii2-bootstrap-wizard "*"

我得到以下消息:

代码语言:javascript
复制
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:

代码语言:javascript
复制
{
    "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\\": ""
        }
    }
}

作曲家信息:

代码语言:javascript
复制
sudo composer self-update
You are already using composer version b2173d28fc8b56236eddc8aa10dcda61471633ec.
EN

回答 2

Stack Overflow用户

发布于 2015-06-18 17:01:31

因为VinceG/twitter-bootstrap-wizard不是Composer包(它不包含composer.json),所以必须在composer.json中对其进行定义

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

代码语言:javascript
复制
"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包。

票数 1
EN

Stack Overflow用户

发布于 2017-05-08 19:17:08

问题可能是项目根composer.json中定义的最小稳定性(或者,如果没有定义,它缺省为稳定)

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

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

请注意,如果您使用来自不同项目的这个包,则需要在该项目中定义最小稳定性:"@dev“,或者在根composer.json中定义"VinceG/twitter-bootstrap-wizard":”@dev

在composer中也有一个选项,可以让你指定:“首选-稳定”

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30896930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档