本文介绍了Composer找不到本地vcs依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,取决于本地包,它本身取决于另一个本地pakcage。



项目

 {
...
repositories:[
{
packagist:false
},
{
type:vcs,
url:/ path / to / local / package1
},
],
require:{
local / package1:dev-master
}
...
}



1

 {
...
repositories:[
{
packagist:false
},
{
type:vcs,
url:/ path / to / local / package2
},

require:{
local / package2:dev-master
}
...
} pre>

当我在 package1 上做一个 composer install ,一切工作正常, packages2 被找到并安装。但是当我在项目上找不到 package2 时出现此错误:

 
问题1
- 本地/ package1 dev-master的安装请求 - >可满足本地/ package1 [dev-master]。
- local / package1 dev-master需要local / package2 dev-master - >找不到匹配的包。


解决方案

来自作曲家:


I have a project that depends on a local package which in itself depends on another local pakcage.

Project

{
...
  "repositories": [
    {
      "packagist": false
    },
    {
      "type": "vcs",
      "url": "/path/to/local/package1"
    },
  ],
  "require": {
    "local/package1": "dev-master"
  }
...
}

Package 1

{
...
  "repositories": [
    {
      "packagist": false
    },
    {
      "type": "vcs",
      "url": "/path/to/local/package2"
    },
  ],
  "require": {
    "local/package2": "dev-master"
  }
...
}

When I do a composer install on package1, everything works as expected, packages2 is found and is installed. But when I do it on project it cannot find package2 with this error:

 Problem 1
    - Installation request for local/package1 dev-master -> satisfiable by local/package1[dev-master].
    - local/package1 dev-master requires local/package2 dev-master -> no matching package found.
解决方案

From Composer manual:

这篇关于Composer找不到本地vcs依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 14:25