I try to add repository from github (designmodo/Flat-UI), play with config and get errors No valid composer.json was found in any branch or...
, Your requirements could not be resolved to an installable set of packages.
, The requested package designmodo/flat-ui could not be found in any version
What mistake I made in config:
"repositories": {
"flat-ui": {
"type": "package",
"package": {
"name": "designmodo/Flat-UI",
"version": "1.3.0", // Don't know is it important? Where get this number in repo?
"source": {
"url": "https://github.com/designmodo/Flat-UI",
"type": "git",
"reference": "dev-master" // reference is branch name?
}
}
}
},
"require": {
"twbs/bootstrap-sass": "~3.2",
"designmodo/Flat-UI": "dev-master" // branch again (/minimum-stability?)
},
At some point composer download package but return error (i don't know when he did it, I lookup in vendor folder and designmodo folder was be there).
To configure Composer for your PHP app json file specifies required packages. Verify that a composer. json file is present in the root of your git repository. Run composer install (on your local machine) to install the required packages and generate a composer.
A repository is a package source. It's a list of packages/versions. Composer will look in all your repositories to find the packages your project requires. By default, only the Packagist.org repository is registered in Composer. You can add more repositories to your project by declaring them in composer.
composer. json is a JSON file placed in the root folder of PHP project. Its purpose is to specify a common project properties, meta data and dependencies, and it is a part of vast array of existing projects.
Problem solved. Play around and changed reference
to master
and version to any *
in "designmodo/Flat-UI": "*"
section. After that composer download package via git and update composer.lock
without problems. Should work for any github repos.
Working config:
{
"repositories": {
"flat-ui": {
"type": "package",
"package": {
"name": "designmodo/Flat-UI",
"version": "1.3.0",
"source": {
"url": "https://github.com/designmodo/Flat-UI",
"type": "git",
"reference": "master"
}
}
}
},
"require": {
"twbs/bootstrap-sass": "~3.2",
"designmodo/Flat-UI": "*"
},
}
https://getcomposer.org/doc/05-repositories.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With