hamitana
hamitana

Reputation: 136

Getting error "No driver found to handle VCS repository" on Composer and SVN

I'm new with Composer, I've already followed https://getcomposer.org/doc/05-repositories.md#subversion-options structure to create example using Composer.

Howerver, I'm getting following error message with Composer and SVN when using command composer install:

[InvalidArgumentException]
No driver found to handle VCS repository http://myexamplesvn/MyCommon-1.0/.....

Here is my setting:

"repositories": [
    {
        "type": "vcs",
        "url": "http://myexamplesvn/MyCommon-1.0/"
    }
],
"require": {
    "my-common/my-common":"*"
}

Could you provide me any idea or suggestion?

Upvotes: 12

Views: 18202

Answers (4)

AeonOfTime
AeonOfTime

Reputation: 1006

As I just found out, another source for this issue can simply be the access rights to the target SVN repository.

I had the following setup in composer.json to connect to the repository:

"repositories": [
    {
        "type": "vcs",
        "url": "https://host.com/RepositoryName/",
        "trunk-path": "trunk",
        "branches-path": "branches",
        "tags-path": "tags"
    }
],
"http-basic": {
    "host.com": {
        "username": "(username)",
        "password": "(password)"
    }
},
"require": {
    "company/project": "dev-branchname"
},    

The problem was that the user defined in the http-basic section was not authorized to browse the whole repository. The SVN administrator had limited the access to the target branch only.

This was certainly an edge case, but I believe that it is still a good idea to check the repository's access rights, before trying to search for more exotic reasons.

Upvotes: 0

Albert Abdonor
Albert Abdonor

Reputation: 961

This can have a lot of different possibilities, but it also happen when your repository is linked with ssh private/public keys, and your private key is unprotected. The solution is to set it to 600, example below:

sudo chmod 600 ~/.ssh/id_rsa

Upvotes: 0

Jagadesha NH
Jagadesha NH

Reputation: 2748

If your pulling package locally, make sure to

git init 

and commit

Upvotes: 3

ZoidbergWill
ZoidbergWill

Reputation: 317

I was having a similar issue with a github repo when using the HTTPS address:

{
    "type": "vcs",
    "url": "https://github.com:<user>/<repo>"
}

but using the SSH .git path worked for me:

{
    "type": "vcs",
    "url": "[email protected]:<user>/<repo>.git"
}

If the repo that you're using doesn't have a composer.json then a composer.json with code like this might work:

"require": {
    "<user>/<repo>": "dev-<branch>"
},
"repositories": [
    {
        "type": "package",
        "package": {
            "name": "<user>/<repo>",
            "version": "dev-<branch>",
            "dist": {
                "url": "https://github.com/<user>/<repo>/archive/<branch>.zip",
                "type": "zip"
            }
        }
    }
]

Upvotes: 12

Related Questions