composer: Could not find package * at any version for your minimum-stability (stable). Check the package spelling or your min imum-stability
With the following composer.json:
{
"name": "ivantree/yii2-vticker",
"description": "Vertical News Ticker",
"type": "yii2-extension",
"keywords": ["yii2","extension"],
"license": "Apache-2.0",
"authors": [
{
"name": "Ivantree",
"email": "cxmiaomu@qq.com"
}
],
"require": {
"yiisoft/yii2": "*"
},
"autoload": {
"psr-4": {
"ivantree\\vticker\\": ""
}
}
}
When I run this command:
php composer.phar require “ivantree/yii2-vticker”: “*” -vvv composer command -vvv (please include -vvv!)
I get this output:
Reading ./composer.json
Loading config file C:/Users/Buybuy/AppData/Roaming/Composer/config.json
Loading config file C:/Users/Buybuy/AppData/Roaming/Composer/auth.json
Loading config file ./composer.json
Checking CA file C:\Users\Buybuy\AppData\Local\Temp\composer-cacert-39eaf16e26c08cc90d728865f1c60406ee5d864d5963f72ede2a1cbb127f95ca.pem
Executing command (D:\wamp\buybuy): git branch --no-color --no-abbrev -v
Executing command (D:\wamp\buybuy): git describe --exact-match --tags
Reading C:/Users/Buybuy/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/Buybuy/AppData/Roaming/Composer/config.json
Loading config file C:/Users/Buybuy/AppData/Roaming/Composer/auth.json
Loading config file C:/Users/Buybuy/AppData/Roaming/Composer/composer.json
Loading config file C:\Users\Buybuy\AppData\Roaming\Composer/auth.json
Reading D:\wamp\buybuy/vendor/composer/installed.json
Reading C:/Users/Buybuy/AppData/Roaming/Composer/vendor/composer/installed.json
Loading plugin yii\composer\Plugin
Loading plugin Fxp\Composer\AssetPlugin\FxpAssetPlugin
Downloading https://packagist.phpcomposer.com/packages.json
Writing C:/Users/Buybuy/AppData/Local/Composer/repo/https---packagist.phpcomposer.com/packages.json into cache
Downloading https://packagist.phpcomposer.com/p/all%2447fd69b4c720d0f9b9aaa6857cc58136c90af2e9b2f7981d7c353f94b1dd9b80.json
Writing C:/Users/Buybuy/AppData/Local/Composer/repo/https---packagist.phpcomposer.com/p-all.json into cache
[InvalidArgumentException]
Could not find package * at any version for your minimum-stability (stable). Check the package spelling or your min
imum-stability
Exception trace: () at phar://D:/wamp/buybuy/composer.phar/src/Composer/Command/InitCommand.php:642
Composer\Command\InitCommand->findBestVersionForPackage() at phar://D:/wamp/buybuy/composer.phar/src/Composer/Command/InitCommand.php:365 Composer\Command\InitCommand->determineRequirements() at phar://D:/wamp/buybuy/composer.phar/src/Composer/Command/RequireCommand.php:108 Composer\Command\RequireCommand->execute() at phar://D:/wamp/buybuy/composer.phar/vendor/symfony/console/Command/Command.php:259
Symfony\Component\Console\Command\Command->run() at phar://D:/wamp/buybuy/composer.phar/vendor/symfony/console/Application.php:844
Symfony\Component\Console\Application->doRunCommand() at phar://D:/wamp/buybuy/composer.phar/vendor/symfony/console/Application.php:192
Symfony\Component\Console\Application->doRun() at phar://D:/wamp/buybuy/composer.phar/src/Composer/Console/Application.php:166
Composer\Console\Application->doRun() at phar://D:/wamp/buybuy/composer.phar/vendor/symfony/console/Application.php:123 Symfony\Component\Console\Application->run() at phar://D:/wamp/buybuy/composer.phar/src/Composer/Console/Application.php:99
Composer\Console\Application->run() at phar://D:/wamp/buybuy/composer.phar/bin/composer:43
require() at D:\wamp\buybuy\composer.phar:25
And I expected this to happen:
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 23 (3 by maintainers)
The problem is your command
composer require "ivantree/yii2-vticker": "*"
, you shouldn’t have a space there, because it sees it as two package names then. Userequire "ivantree/yii2-vticker:*"
I ended up flagging the dependency with
@dev
like this:Yeah, @superwebdeveloper I think when you first create a repo and connect to Packagist, you need to create a “release” in Github. If not, it defaults to “dev-master” which if the repo/project you are trying to add to has “stable” as the minimum stability, it causes problems here. But if you go into Github for your new repo and navigate to “Release” and create a new release, even one tagged “0.0.1” then Packagist (Composer) will accept that as a satisfactory minimum-stability match.
thank you 👍 😃
That’s because https://packagist.org/packages/ivantree/yii2-vticker only exists in dev-master and that is too unstable for your minimum-stability, the error message isn’t clear but will be fixed by #5120
Have a look at yout composer.lock, you’ll maybe find a line like:
"minimum-stability": "stable",
I have encountered the same problem. I can not require my package via composer, i always get a fu*king error message “Could not find package tantana5/laravel-settings at any version for your minimum-stability (dev). Check the package spelling or your minimum-stability”. I went crazy for 2 days…
I did all the above but failed:
Finally, I found the cause. Github is not the main Composer repository, but the packagist.org You must submit your package with https://packagist.org/packages/submit You can manual update in packagist or use webhook in github automaticaly
curl
-X POST
-H ‘Content-Type: application/json’
-d ‘{“repository”:{“url”:“https://github.com/tantana5/laravel-settings”}}’
‘https://packagist.org/api/update-package?username=tantana5&apiToken=MY_API_TOKEN’
Of course, You must git push tag and release version in github
https://jameshfisher.com/2017/11/06/how-to-release-a-composer-package.html Hope to help someone.
There simply is no such package on packagist.org. If this package is provided by another repository, you need to add this repository explicitly to your
composer.json
file.It is worth to be said this issue disappears when calling the “composer require …” from the root directory of the project.