Answer the question
In order to leave comments, you need to log in
How to deal with "no matching package found." (assuming the package actually exists)?
Hello!
During the development of a package ( пакет_№_1
), it may be necessary to include another package ( пакет_№_2
) in a section require
( PS NOT IN require-dev
). APP
I use it in the application and пакет_№_1
I know that the dependent one will automatically be pulled пакет_№_2
into my application. But, unfortunately, this does not happen ( that is, when the package is installed, its dependencies are not pulled up ), for the reason described below:
PS I use windows. All packages are located locally on disk.
PSS folder hierarchy:
../test.loc
..../laravel (тут лежит приложение)
..../packages (тут лежат мои пакеты)
....../catalog (пакет каталога)
....../category (пакет категории)
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"test/catalog": "1.0.0" // прошу заметить, что тут я указываю конкретную версию
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"barryvdh/laravel-ide-helper": "v2.2.1"
},
"repositories": [
{"type": "git", "url": "C:\\web\\www\\test.loc\\packages\\test\\catalog"}
],
// .... я специально тут обрезал, т.к. далее идет запуск доп. скриптов и определение PSR4
}
пакет_№_1
(catalog){
"name": "test/catalog",
"authors": [
{
"name": "test",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.6.4",
"test/category": "1.0.0"
},
"repositories": [
{"type": "git", "url": "C:\\web\\www\\test.loc\\packages\\test\\category"}
],
"autoload": {
"psr-4": {
"Test\\Catalog\\": "src/"
}
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "master"
}
}
}
пакет_№_2
(category){
"name": "test/category",
"authors": [
{
"name": "test",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.6.4"
},
"autoload": {
"psr-4": {
"Test\\Category\\": "src/"
}
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "master"
}
}
}
пакет_№_1
(catalog) and execute the command composer update
, then пакет_№_2
(category) will automatically be pulled into the vendor folder ( as if everything works correctly here ). APP
and execute the command composer update
, it gives an error:Loading composer repositories with package information
Reading composer.json of test/catalog (1.0.0)
Reading composer.json of test/catalog (@dev)
Reading composer.json of test/catalog (master)
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for test/catalog 1.0.0 -> satisfiable by test/catalog[1.0.0].
- test/catalog 1.0.0 requires test/category 1.0.0 -> 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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
composer clear-cache
- it did not help. composer prohibits test/catalog 1.0.0
- gives an error ( Could not find package "test/catalog" in your project ) test.loc/packages/catalog# git tag
1.0.0
test.loc/packages/category# git tag
1.0.0
пакет_№_2
(catalog) in APP ? APP
we specify in the composer.json application:"repositories": [
{"type": "git", "url": "C:\\web\\www\\test.loc\\packages\\test\\catalog"},
{"type": "git", "url": "C:\\web\\www\\test.loc\\packages\\test\\category"}
],
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question