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": "[email protected]"
}
],
"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:
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. Use require "ivantree/yii2-vticker:*"
@Seldaek
it still no worked:
Problem 1
- The requested package ivantree/yii2-vticker could not be found in any version, there may be a typo in the package name.
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
Thanks to Seldaek it worked. close up the space between colon and quote mark ": "*"
command line :-
composer require magearray/restrictshippingpayment
[InvalidArgumentException]
Could not find package magearray/restrictshippingpayment at any version for your minimum-stability (alpha). Check he package spelling or your minimum-stability
please help me
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.
this is an issue that comes up when trying out composer for a project the first time. This means it is happening because of something I dont know yet, but as of yet, I cannot tell what that is.
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.
@ahuggins thank you for the response. I did create a release with my test package and.... ok I got a different error, I will be working on that one later. thanks, for the reply.
Thanks for everyone!
As for me with similar issue, my fix was putting the ~
before the package name. For example composer require "pack/package ~0.0.1"
. This was after I created a Release 0.0.1 on Github
I ended up flagging the dependency with @dev
like this:
composer require "castlepointanime/brancher @dev"
This feels wrong - how do you set minimum stability differently?
Have a look at yout composer.lock, you'll maybe find a line like:
"minimum-stability": "stable",
@ahuggins your answer is very helpful.to fixed the problem spend any time until see your answer
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.
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...
I ended up flagging the dependency with
@dev
like this:composer require "castlepointanime/brancher @dev"
thank you 馃憤 :)
you must register at packagist.org, not packagist.com
It is worth to be said this issue disappears when calling the "composer require ..." from the root directory of the project.
And I had to wait 2 Minutes after releasing tag 0.01...
Most helpful comment
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:*"