php 作曲家要求:找不到包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47050781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 02:31:31  来源:igfitidea点击:

Composer Require: Could not find package

phpcomposer-php

提问by xendi

I'm trying to use this: https://github.com/digitaldonkey/ethereum-php

我正在尝试使用这个:https: //github.com/digitaldonkey/ethereum-php

so I run: composer require digitaldonkey/ethereum-phpbut I get:

所以我跑:composer require digitaldonkey/ethereum-php但我得到:

[InvalidArgumentException]
Could not find package digitaldonkey/ethereum-php at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

[InvalidArgumentException]
找不到任何版本的包 digitaldonkey/ethereum-php 以达到您的最低稳定性(稳定)。检查包拼写或您的最低稳定性

So I imagine I need to specify some other branch but what?

所以我想我需要指定一些其他分支但是什么?

采纳答案by René H?hle

Open your composer.jsonif that package has no stable version then you have to change your minimum-stabilityto dev.

composer.json如果该软件包没有稳定版本,请打开您的软件包,然后您必须minimum-stabilitydev.

https://getcomposer.org/doc/04-schema.md#minimum-stability

https://getcomposer.org/doc/04-schema.md#minimum-stability

回答by Afraz Ahmad

The reason behind this error is your git repo does not contain any tags.

此错误背后的原因是您的 git repo 不包含任何标签。

Add tags like

添加标签,如

git tag -a 1.0.0
git push --tags

Now you can use

现在你可以使用

composer require digitaldonkey/ethereum-php

ExplanationIf we see composer.json, you will find require tag which contains packages along with their versions. e.g.

说明如果我们看到 composer.json,您会发现 require 标签,其中包含包及其版本。例如

"require": {
    "php": ">=7.0.0",
    "afrazahmad/clear-cached-data": "^1.0"
},

So versions or tags are important. Hope it helps.

所以版本或标签很重要。希望能帮助到你。

回答by mrcoder

If you are adding to a different folder other than the project, you get the same error. delete your previous installation and try cd project_name.

如果要添加到项目以外的其他文件夹,则会出现相同的错误。删除您以前的安装并尝试 cd project_name。