I am trying to install Yii2 alpha. When I run the following command after downloading composer and adding
"minimum-stability": "dev"
to composer.json.
$ php composer.phar require yiisoft/yii2-framework "*"
I get the following error.
Problem 1
- The requested package minimum-stability could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package yiisoft/yii2-composer could not be found in any version, there may be a typo in the package name.
Problem 3
- The requested package yiisoft/yii2-framework 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 http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
Please help me.
start with
php composer.phar init
and set Minimum Stability[] to dev
then
php composer.phar require yiisoft/yii2 "*"
Here is working composer.json code
{
"name": "yiisoft/yii2-app-advanced",
...
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
},
"require-dev": {
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*"
},
...
}
Use yii2 against yii2-framework, may be you typed "minimum-stability" in the wrong place. And you don't need type yii2-composer there, it will be installed automatically
Related
I have two Symfony projects: project-a (root project) and project-b.
My composer.json file from project-a contains:
{
"name": "myprojects/project-a",
"require": {
"myprojects/project-b": "dev-master",
},
"repositories": [
{
"type": "vcs",
"url": "git#bitbucket.org:MYPROJECTS/project-b.git"
}
]
}
And my composer.json from project-b:
{
"name": "myprojects/project-b",
"require": {
"guzzlehttp/guzzle": "^6.3"
}
}
I need to update project-b but when I execute the command composer update myprojects/project-b from project-a, I get this composer error:
[Composer\DependencyResolver\SolverProblemsException]
Problem 1
Installation request for myprojects/project-b dev-master -> satisfiable by
myprojects/project-b[dev-master].
myprojects/project-b dev-master requires guzzlehttp/guzzle ^6.3 -> no matching package found.
Potential causes:
A typo in the package name
The package is not available in a stable-enough version according to your minimum-stability setting
I have tried solve this adding "minimum-stability": "dev" property to both composer.json files, but it doesn't works.. How can I solve this?
Thanks.
As commented in guzzle/guzzle issue 861:
Looks like an issue with your caching.
Try clearing your composer cache, and self-update composer, then try again.
The OP Wildchild confirms in the comments:
composer clear cache and self-update solves my problem
"minimum-stability": "dev" is not needed.
I was working on a project and ended up having to make a small change to one of the packages I'm using.
That package is: shopifyextras/shopify-php-api-wrapper
Which you can find here: https://github.com/ShopifyExtras/PHP-Shopify-API-Wrapper
My previous composer.json file looked like this:
{
"require": {
"monolog/monolog": "1.*",
"shopifyextras/shopify-php-api-wrapper": "^1.1"
},
"autoload": {
"psr-0": { "MyApp\\": "src/" }
}
}
After forking the repo and making my changes (I forgot to create a new branch first, but created the branch after committing to master, and pushed it to github - I don't think this should cause any issues given that the branch exists and it does point to the correct head), I then updated my composer.json to use my fork.
After reading the composer docs (https://getcomposer.org/doc/05-repositories.md#vcs) I updated my composer.json to the following:
{
"minimum-stability": "dev",
"prefer-stable" : true,
"repositories": [
{
"type": "git",
"url": "https://github.com/JonLaliberte/PHP-Shopify-API-Wrapper.git"
}
],
"require": {
"monolog/monolog": "1.*",
"shopifyextras/shopify-php-api-wrapper": "dev-risksbugfix"
},
"autoload": {
"psr-0": { "MyApp\\": "src/" }
}
}
When I run composer update I receive the following error:
$ composer update --verbose
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package shopifyextras/shopify-php-api-wrapper 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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
I have tried:
Using "risksbugfix" instead of "dev-risksbugfix"
Using type "vcs" instead of git"
Removing ".git" from the repo URL
Using "jonlaliberte/shopify-php-api-wrapper" instead of "shopifyextras/shopify-php-api-wrapper"
Any help would be greatly appreciated. Thanks!
Branch Alias
If you alias a non-comparable version (such as dev-develop) dev- must
prefix the branch name.
You branch is a non-comparable version dev-riskbugfix.
You might need to prefix it with dev-: dev-dev-riskbugfix.
Or rename the branch to riskbugfix and get rid of the dev-, then the alias would be dev-riskbugfix.
What do I add in my Composer.json file so it downloads version 2.3.5 of the Zend Framework? I've tried reading the Zend docs but it doesn't mention Composer.
{
"require" : {
"silex/silex": "~1.1",
"monolog/monolog": "~1.7",
"aws/aws-sdk-php": "~2.6",
"zendframework/zendservice-amazon": "2.3.5"
},
"require-dev": {
"heroku/heroku-buildpack-php": "*"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.zendframework.com/"
}
]
}
After I run composer update, it gives me this error message:
C:\Users\Ricky\graffiti-galore>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package zendframework/zendservice-amazon 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 http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
In your require statement, it looks like you're using the wrong include for Zend. In your require statement:
"zendframework/zendservice-amazon": "2.3.5"
should be
"zendframework/zend-config": "2.3.5",
"zendframework/zend-http": "2.3.5"
Or if you want to avoid requiring a specific version number,
"zendframework/zend-config": "2.*",
"zendframework/zend-http": "2.*"
and for the part in minimum stability
"minimum-stability": "dev"
zendservice-amazon is not part of Zend Framework 2, none of the ZendService libs are. Its latest version is 2.0.3, all versions are listed here: https://packagist.org/packages/zendframework/zendservice-amazon
There is no version 2.3.5 for zendframework/zendservice-amazon, so obviously the install fails. Look at https://packagist.org/packages/zendframework/zendservice-amazon to see the available versions and fix the version selector (I'd suggest ~2.0).
You also don't need the repositories part in your composer.json, all the packages are also on Packagist, Composer's main and default package repository.
I am reading this official facebook https://developers.facebook.com/docs/php/gettingstarted/4.0.0 page.
I want to add the facebook sdk to my project
I tried to do this:
composer require facebook/php-sdk in the root of my project and I got this
Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "C:\ProgramData\ComposerSetup\bin\composer.phar self-
update" to get the latest version.
Please provide a version constraint for the facebook/php-sdk requirement: **4**
as you see, I have chosen 4, then I got this error message:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package facebook/php-sdk 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 min
imum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
problems.
Installation failed, reverting ./composer.json to its original content.
why is that please? notice please that I didn't add anything to my composer.json.
I opened the composer.json and I found this line:
"require": {
"laravel/framework": "4.2.*"
},
so should I change it to :
"require": {
"laravel/framework": "4.2.*",
"facebook/php-sdk-v4" : "4.0.*"
},
or should I keep it and add a new require entity like this:
"require" : {
"facebook/php-sdk-v4" : "4.0.*"
}
just try and add facebook/php-sdk-4 to your existing require hash and then run composer update.
"require": {
"laravel/framework": "4.2.*",
"facebook/php-sdk-v4" : "4.0.*"
}
I have written a library that I want to use in another project. However, when I add the library dependency to my project I get the following error after running composer update -vvv:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for my/library dev-master -> satisfiable by my/library[dev-master].
- my/library dev-master requires doctrine/migrations dev-master -> no matching package found.
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.
This error is very confusing to me since my project has my library as it's only dependency, i.e. my project composer.json looks like this:
{
"name": "my/project",
"type": "project",
"description": "My project",
"autoload": {
"psr-0": { "MyNamespace\\": ["src/", "tests/src/"] }
},
"repositories": [ {
"type": "vcs",
"url": "git#bitbucket.org:my/library"
} ],
"require": {
"php": ">=5.5",
"my/library": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.*"
}
}
As you can see, pretty straight forward. The reason the version of my library is requiring dev-master is because master is currently the only branch I work on (I work alone, no need for other branches at the moment).
So far the only way for the resolve this problem is by adding the dependencies of my library composer.json to my project's composer.json which seems like an unnecessary step.
How can I resolve this dependency issue?
It looks to me as if it is a stability issue. Add the following two lines to your composer.json:-
"minimum-stability": "dev",
"prefer-stable": true,
ref:- minimum-stability & prefer-stable
Hopefully that will sort out your problem.