Getting a “No such remote or remote group” error when trying to use a private repo in Composer

邮差的信 提交于 2019-12-11 06:24:16

问题


I'm getting an error when I try to run composer. I have the following in my composer.json:

{
    "require": {
        "my/private-repo": "dev-development"
    },
    "repositories": [
            {
            "type": "git",
            "url": "git@bitbucket.org:my/private-repo.git"
        }
    ],
}

In that private bitbucket repo, there's a composer.json with a name of "my/private-repo", and there's a branch called development.

When I try to run composer, I get this error: "Failed to update git@bitbucket.org:my/private-repo.git, package information from this repository may be outdated (fatal: No such remote or remote group: origin". I have no idea why it's mentioning origin at all; I've got that private repo in a totally separate folder on this composer, so it shouldn't be looking in there. I can git clone my/private-repo just fine, so it's not an SSH issue. Any ideas?


回答1:


So it turns out this was just an issue with Composer caching. I ran rm -rf ~/.composer/cache/ and tried updating again, and everything works.




回答2:


I also had this problem but it was caused because of something I did. I have two projects setup. One was a dependency on the other. I used composer to manage this dependency. For testing purposes, I deleted the dependency from vendor/namespace/my-lib and created a symlink to the other project. Then I could update code on the fly and commit when I was done. When I later tried to do a composer update I received the error above.

To resolve the problem I deleted my symlink and then ran composer update. It properly downloaded the dependency and everything was fine.



来源:https://stackoverflow.com/questions/20601634/getting-a-no-such-remote-or-remote-group-error-when-trying-to-use-a-private-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!