Composer忽略了我的本地repo包,它试图从远程VCS repo下载它



我正在尝试使用我的vendor-legacy文件夹中的一个软件包。

这个文件夹的结构如下:

vendor-legacy
└── directus
├── oauth2-okta
├── proxy-detection
├── rate-limit
└── zend-db

在我的composer.json文件中,我将其声明为:

"repositories": [
{
"type": "path",
"url": "vendor-legacy/directus/oauth2-okta"
},
{
"type": "path",
"url": "vendor-legacy/directus/proxy-detection",
"options": {
"versions": {
"directus/proxy-detection": "0.5.1"
}
}
},
{
"type": "path",
"url": "vendor-legacy/directus/rate-limit"
}
],
"require": {
"directus/oauth2-okta": "dev-master",
"directus/proxy-detection": "*",
"directus/rate-limit": "dev-master",
},

下面是我在composer update --ignore-platform-reqs

之后得到的结果
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing directus/proxy-detection (0.5.1): Downloading (failed)    Failed to download directus/proxy-detection from dist: The "https://api.github.com/repos/directus/proxy-detection/zipball/e1fd098352dec991bb857e216a099a0758615328" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
- Installing directus/proxy-detection (0.5.1): Cloning e1fd098352
                                                                                                                                                                 
[RuntimeException]                                                                                                                                                                                                                   
Failed to execute git clone --no-checkout 'https://***:***@github.com/directus/proxy-detection.git.git' '/Users/owls/unsound-website/unsound-directus/vendor/directus/proxy-detection' && cd '/Users/owls/unsound-website/unsound-d  
irectus/vendor/directus/proxy-detection' && git remote add composer 'https://***:***@github.com/directus/proxy-detection.git.git' && git fetch composer && git remote set-url origin 'https://github.com/directus/proxy-detection.g  
it.git' && git remote set-url composer 'https://github.com/directus/proxy-detection.git.git'                                                                                                                                         
                                                                                                                                                                 
Cloning into '/Users/owls/unsound-website/unsound-directus/vendor/directus/proxy-detection'...                                                                                                                                       
remote: Repository not found.                                                                                                                                                                                                        
fatal: repository 'https://github.com/directus/proxy-detection.git.git/' not found                                                                                                                                                   
                                                                                                                                                                 
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

包oauth2-okta和rate-limit安装正确,并符号链接到我的vendor文件夹。只是这个代理检测似乎有一个问题,我不明白。如果有人遇到这个问题,我很乐意提供帮助。

我不确定主要问题是什么,但我通过添加:

"extra": {
"branch-alias": {
"dev-master": "0.5.1"
}
},

作曲家。代理检测包内的Json,

然后在根composer.json中,我所要做的就是声明依赖版本为dev-master

我不知道为什么将版本设置为0.5.1直接导致问题。

希望这个解决方案对将来的人有所帮助。

最新更新