Composer找不到私有托管包

时间:2016-08-02 14:47:44

标签: php git composer-php bitbucket

因此,作曲家搜索工作并确实返回包含其描述的包。此外,它会提示我进行身份验证以获取该信息。问题是,当我运行composer info tradedefender / xignite-options-reader时,它会给我一个Package not found错误。尝试安装程序包时遇到同样的问题。这是我的应用程序的composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "repositories": [
      {
        "type": "vcs",
        "url": "https://jrgilman@bitbucket.org/tradedefender/xignite-options-reader.git"
      }
    ],
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

这是我的包的composer.json:

{
    "name": "tradedefender/xignite-options-reader",
    "version": "master",
    "description": "Reads options data from Xignite using PHP/Python",
    "license": "proprietary",
    "authors": [
        {
            "name": "Jacob Ray Gilman",
            "email": "jacob.r.gilman@gmail.com"
        }
    ],
    "minimum-stability": "dev",
    "require": {},
    "autoload": {
      "psr-4": {
        "TradeDefender\\XigniteOptionsReader\\": "/src/php"
      }
    }
}

以下是CLI的问题:

jacob@jacob-MS-7693:~/Documents/test-env$ composer search tradedefender
    Authentication required (bitbucket.org):
      Username: XXXXXXXX@XXXXXXXX
      Password: 
Do you want to store credentials for bitbucket.org in /home/jacob/.composer/auth.json ? [Yn] n
tradedefender/xignite-options-reader Reads options data from Xignite using PHP/Python
jacob@jacob-MS-7693:~/Documents/test-env$ composer info tradedefender/xignite-options-reader


  [InvalidArgumentException]                              
  Package tradedefender/xignite-options-reader not found

1 个答案:

答案 0 :(得分:1)

我的Composer版本包含composer info --help的以下输出:

-i, --installed
    List installed packages only (enabled by default, only present for BC).

默认情况下,composer info看起来只是查看已安装的软件包。添加--all标志(以显示已安装和可用的包)或-a / --available标志(以显示可用的包)应该可以使其工作:

composer info --all tradedefender/xignite-options-reader

它与私有存储库无关。