我在github上创建了两个测试存储库。 composer-test和composer-test-inc比我创建两个包装内容tarach/composer-test和tarach/composer-test-inc
致电:
$ composer require -vvv tarach / composer-test-inc:v1.0-alpha 我收到了回复:
$ composer require -vvv tarach/composer-test-inc:v1.0-alpha
Reading ./composer.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Failed to initialize global composer: Composer could not find the config file: C:/Users/tarach/AppData/Roaming/Composer/composer.json
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
./composer.json has been created
Reading ./composer.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Failed to initialize global composer: Composer could not find the config file: C:/Users/tarach/AppData/Roaming/Composer/composer.json
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-2013.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014-07.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-2014-10.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-01.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-2015-04.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-archived.json from cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/p-provider-latest.json from cache
Downloading http://packagist.org/p/tarach/composer-test-inc$93dc775f482417914700941d53672a4e763c0d54604fe4fda2346134b51359d5.json
Writing C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/provider-tarach$composer-test-inc.json into cache
Reading C:/Users/tarach/AppData/Local/Composer/repo/https---packagist.org/provider-tarach$composer-test.json from cache
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for tarach/composer-test-inc v1.0-alpha -> satisfiable by tarach/composer-test-inc[v1.0-alpha].
- tarach/composer-test-inc v1.0-alpha requires tarach/composer-test v1.0-alpha5 -> 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.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, deleting ./composer.json.
之前我曾尝试添加zf2框架组件,以了解它如何处理来自其他存储库的需求,但它并没有。我已将其从依赖项中删除。执行后我也用
$ composer clearcache
我做错了什么?
答案 0 :(得分:0)
Composer从packagist中读取包。如果您的包不在packagist上,而是在github上,则必须配置VCS package。
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/igorw/monolog"
}
],
"require": {
"monolog/monolog": "dev-bugfix"
}
}