如何使用Composer安装Composer? [英] How to install Composer using Composer?

查看:163
本文介绍了如何使用Composer安装Composer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:解决了,我必须使用 dev-master而不是 master或 dev。

solved, I have to use "dev-master" instead of "master" or "dev".

也许是这样似乎对您来说很奇怪...但是我正在尝试使用全局composer二进制文件在本地安装composer。

maybe this seems weird to you... but I'm trying to locally install composer using a global composer binary.

我正在尝试编写以下内容:

I'm trying to write something like:

composer require composer/composer

但这不起作用,它告诉我需要版本。然后,我尝试了以下变体:

But this doesn't work, it tells me that needs the version. Then I've tried the following variations:

composer require composer/composer=*
composer require composer/composer=master
composer require composer/composer=dev

而且...什么都没有,我得到了出现以下错误消息:

And... nothing, I obtain the following error message:

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

  Problem 1
    - The requested package composer/composer 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.

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

任何人都知道是否有可能以干净的方式进行吗? (允许以下几点):

Anyone has any idea if it's possible to do it in a "clean" way? (Allowing the following points):


  • 指定非常具体的版本

  • 在作曲家中注册.json和composer.lock文件

  • 将composer二进制文件与其他php二进制文件(如behat)一起放置...

推荐答案

不明白为什么要这么做,但是我认为#EDIT:看到了为什么需要这个。好的。

Don't understand why do you want this, but I think #EDIT : Saw why you need this. Ok.

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/composer/composer.git"
    }
],
"require": {
    "composer/composer": "dev-master#775f6cd5c633facf2e7b99611fdcaa900b58ddb7"
}

将可以。

您可以在此处查看与不同发行版相对应的提交哈希: https:/ /github.com/composer/composer/releases

You can view here the commit hash corresponding to different releases : https://github.com/composer/composer/releases

这篇关于如何使用Composer安装Composer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆