composer-php - 作曲家不承认分叉回购包括
问题描述
我在尝试通过 Composer 将分叉的开源存储库包含到我的项目中时遇到问题。我已经在 Github 上创建了一个存储库,创建了一个分支,进行了相关更改,并试图通过我的 composer.json 文件通过以下方式包含它
...
"require": {
...
"my-github-name/forked-repo-name": "dev-fix"
...
},
"repositories": {
...
"8": {
"type": "vcs",
"url": "git@github.com:my-github-name/forked-repo-name.git"
},
...
} ...
我尝试过包含不同的分支和版本号。这是一个 Magento 2 项目,我的 composer.json 文件当然有更多的东西,因此我添加的点来表示之前和之后的项目。
我收到以下作曲家错误:
The requested package my-github-name/forked-repo-name could not be found in any version, there may be a typo in the package name.
我正在使用 PHP 7.0.22
该存储库不是私有的,它似乎无法找到它。
谢谢
解决方案
我强烈建议在这种情况下使用https
而不是ssh
:
"url": "https://github.com/my-github-name/forked-repo-name.git"
推荐阅读
- javascript - Elasticsearch Vs MongoDB Aggregation - 开发对比与示例
- symfony - Html 中的页码(不在 headerTemplate 或 footerTemplate 中)ChromePDF
- angular - 使用 angular-fontawesome 和 font-awesome 5 时找不到 FaIconLibrary
- android - Android Q 中 Wifi 管理器 removeNetwork() 的替代方案。新 Api WifiNetworkSuggestion 仅删除建议
- android - 如何在 nativescript 中设置最大高度?
- ksqldb - 生成的 KSQL 连接流显示没有数据
- javascript - jwplayer 外部播放暂停按钮
- python - 如何处理“TypeError:__init__() 缺少 1 个必需的位置参数:'path'”
- php - Ajax 搜索表不工作/无法获取数据 - Codeigniter
- amazon-web-services - ALB 抛出 ERR_CONNECTION_RESET