git - composer require package_name requested for api/v3 而不是 gitlab 上的 api/v4

标签 git composer-php gitlab

当我想要一个包with composer时,它会返回一条错误信息:

Composer 需要 Bugloos/file-manager-bundle:1.0.6

Installation failed, reverting ./composer.json to its original content.                                                                                   
  [Composer\Downloader\TransportException]                                                          
  The "https://gitlab.com/api/v3/projects/bugloos%2Flogin%2Dbundle" file could not be downloaded (HTTP/1.1 410 Gone)                                                                                

但是如果我点击带有 v4 版本的链接,gitlab 将返回正确的响应,我不知道如何告诉 gitlab 以 v4 版本响应我?

"repositories": [
{
  "type": "vcs",
  "url": "git@gitlab.com:bugloos/login-bundle.git"
},

...

"require": {
   "Bugloos/LoginBundle": "^1.0", ...

...

enter image description here

最佳答案

两年前 Composer 中的这个 was fixed。您需要更新 Composer :

composer self-update

如果全局安装了 composer,则使用 sudo:

sudo -H composer self-update

关于git - composer require package_name requested for api/v3 而不是 gitlab 上的 api/v4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59841195/

相关文章:

continuous-integration - 如何定期运行 gitlab stage?

javascript - Gitlab CI - 服务器在 Cypress 测试可以运行之前获取 'killed'

git - 如何跨 2 个服务器同步 Git 存储库

Git 在更新时默默地 merge 应该发生冲突的内容

git - 如何在 git stash pop 上指定默认 merge 策略

doctrine-orm - 确定 Composer 子依赖

php - 如何在 Symfony 2.1 中使用 Composer 安装自己的包?

git - 阻止 git 处理 "safe deleting"未 merge 的分支

composer-php - “content-hash”是composer.lock的必需部分吗?

docker - 如何使用 docker 为 gitlab 托管的项目运行 gitlab-runner?