php - Composer 强制安装包忽略依赖版本
问题描述
我想将reliese/laravel
(https://github.com/reliese/laravel/)包安装到我的 Laravel 6+ 项目中。reliese/laravel
需要"illuminate/support": "~5.1",
,但我的版本现在是 6+。我已经查看了这个reliese/laravel
包,它应该仍然适用于 6+。如何强制作曲家安装这个包?我试过--ignore-platform-reqs
了,但没有奏效。
解决方案
从作曲家文档开始require
- --ignore-platform-reqs:忽略
php
、和要求并强制安装hhvm
,即使本地机器不满足这些要求。另请参阅平台配置选项。lib-*
ext-*
因此该标志只忽略特定于机器的要求,而不是包版本不匹配。
我建议在 GitHub 上分叉包,像这样手动更改版本要求
{
"require": {
"php": ">=5.6.4",
"doctrine/dbal": "~2.5",
"illuminate/support": "~6.0",
"illuminate/database": "~6.0",
"illuminate/contracts": "~6.0",
"illuminate/filesystem": "~6.0",
"illuminate/console": "~6.0"
}
}
并指示 Composer 从你的 fork 中拉出包composer.json
"require": {
"reliese/laravel": "master",
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/juventus18/laravel"
}
]
推荐阅读
- javascript - 如何在 JavaScript 中正确比较数字
- retrofit - 带有房间和作业调度器的匕首柄
- javascript - amCharts 5:可以在同一画布上堆叠多个图表并在它们之间共享 xAxis
- java - 暂停和恢复线程的问题
- python - Python - 用多波束数据填充单波束缺失的探测范围
- python - 使用 tf.train.Checkpoint 在 keras 中保存 GAN
- python - Python中用于非平方成本矩阵的匈牙利算法
- java - 我是否需要在 Mongo 的这个 POST 请求中进行事务处理?
- mysql - 启用多线程时如何获取最后一个 SQL 复制错误?
- java - 无法通过 Springboot 将短划线保存到 CCSID 37 的 DB2 列