Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer Require: Could not find package

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

so I run: composer require digitaldonkey/ethereum-php but I get:

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

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

like image 974
xendi Avatar asked Nov 01 '17 08:11

xendi


People also ask

Why is composer not installing?

Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

How do I increase composer memory limit?

Use the format “128M” for megabyte or “2G” for gigabyte. You can use the value “-1” to ignore the memory limit completely. Another way would be to increase the PHP memory limit: php -d memory_limit=512M composer.


Video Answer


3 Answers

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

Add tags like

git tag -a 1.0.0
git push --tags

Now you can use

composer require digitaldonkey/ethereum-php

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

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

So versions or tags are important. Hope it helps.

like image 190
Afraz Ahmad Avatar answered Oct 18 '22 05:10

Afraz Ahmad


Open your composer.json if that package has no stable version then you have to change your minimum-stability to dev.

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

like image 9
René Höhle Avatar answered Oct 18 '22 04:10

René Höhle


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.

like image 2
mrcoder Avatar answered Oct 18 '22 04:10

mrcoder