Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer - Unknown downloader type: h - Getting this error for a repo on packigist

Tags:

composer-php

I just put up a package on packagist and I tried to run a composer update and am getting the error:

Unknown downloader type: h. Available types: git, svn, hg, perforce, zip, rar, tar, gzip, phar, file.

In the main project file I have this:

"require": {
    //.......
    "cyphix333/sbb-code-parser": "dev-master"
},

The composer.json file for cyphix333/sbb-code-parser is:

{
    "name": "cyphix333/sbb-code-parser",
    "description": "SBBCodeParser is a simple BBCode parser",
    "keywords": [
        "SBBCodeParser"
    ],
    "homepage": "https://github.com/samclarke/SBBCodeParser",
    "canonical": "https://github.com/cyphix333/SBBCodeParser",
    "source": "https://github.com/cyphix333/SBBCodeParser/tree/master",
    "autoload": {
        "classmap": ["SBBCodeParser.php","classes/"]
    },
    "authors": [
        {
            "name": "Sam Clarke"
        }
    ],
    "require": {
        "php": ">=5.3"
    }
}

I am not sure what I am doing wrong here?

like image 216
Brett Avatar asked Apr 02 '15 18:04

Brett


3 Answers

If you just started getting this error, try composer clear-cache and/or delete ~/.composer and vendor.

The specific error I was getting was:

  [InvalidArgumentException]                                                                                  
  Unknown downloader type: . Available types: git, svn, fossil, hg, perforce, zip, rar, tar, gzip, xz, phar,  
   file, path.     

I just deleted everything and then tried again; works now.

I'm using

Composer version 1.2.0 2016-07-19 01:28:52
like image 96
mpen Avatar answered Nov 18 '22 17:11

mpen


I've solved this issue deleting the vendor directory.

rm -Rf vendor

And then running:

composer update
like image 28
Davide Casiraghi Avatar answered Nov 18 '22 17:11

Davide Casiraghi


Changes to your composer.json: dropped canonical and source; added type library.

Give this one a try:

{
    "name": "cyphix333/sbb-code-parser",
    "description": "SBBCodeParser is a simple BBCode parser",
    "homepage": "https://github.com/samclarke/SBBCodeParser",
    "keywords": ["SBBCodeParser"],
    "type": "library",
    "authors": [
        {
            "name": "Sam Clarke"
        }
    ],
    "require": {
        "php": ">=5.3"
    },
    "autoload": {
        "classmap": ["SBBCodeParser.php", "classes/"]
    }
}
like image 3
Jens A. Koch Avatar answered Nov 18 '22 18:11

Jens A. Koch