我可以重写composer.json依赖项以将其删除吗? [英] Can I override a composer.json dependency to remove it?

查看:60
本文介绍了我可以重写composer.json依赖项以将其删除吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以使用以下方法覆盖作曲家依赖性:

  some / module: 1.0.0 as 2.0 .0,

但是是否可以完全删除我的一个依赖项所需要的依赖项? / p>

问题是我需要 cwp / cwp-recipe-basic: 1.1.0,可以在此处找到。该软件包只是另一个依赖关系列表,但是我不希望这些依赖关系中的一个。



有没有办法告诉作曲家忽略那个依赖关系?



例如

  cwp / cwp-recipe-basic: 1.1。 0,
silverstripe / fulltextsearch: as 1.1.0


解决方案

您可以使用 replace composer.json 中的设置:

 替换:{
silverstripe / fulltextsearch: 1.1.0
}

Composer将充当此软件包的角色,并且不会安装它。请注意,由于它尚未实际安装,因此将无法使用。


I know it's possible to override a composer dependency using:

"some/module": "1.0.0 as 2.0.0",

But is it possible to entirely remove a dependency that one of my dependencies requires?

The issue is that I am requiring "cwp/cwp-recipe-basic": "1.1.0", which can be found here. That package is simply another list of dependencies, however I do not want one of those dependencies.

Is there any way of telling composer to ignore that one dependency?

E.g.

"cwp/cwp-recipe-basic": "1.1.0",
"silverstripe/fulltextsearch": " as 1.1.0"

解决方案

You can use replace setting in your composer.json:

"replace": {
    "silverstripe/fulltextsearch": "1.1.0"
}

Composer will act as this package is already available and will not install it. Note that you will not able to use it, since it is not actually installed.

这篇关于我可以重写composer.json依赖项以将其删除吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆