A
A
Anton2015-12-18 14:46:15
git
Anton, 2015-12-18 14:46:15

How to make composer see private github repository?

There is a private turnip on github with a self-written library, I registered it in the composer

{
    // ...
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/company/name.git"
        }
    ],
    "require": {
        // ...
        "company/name": "dev-master"
    }
}

then I tried to write the OAuth key created in the github in /home/user/.composer/auth.json (this option is not very good, because it allows all the company's progers to access all private projects, which is not always necessary), so and basic http authorization
//first variant
{
    "github-oauth": {
        "github.com": "xxxxxxxxxxxxxxxxxxx"
    }
}

//second variant

{
    "https://api.github.com/user": {
            "username": "username",
            "password": "password"
        },
}

But in the end I get a composer error
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package company/name could not be found in any version, there may be a typo in the package name.

Although the composer itself downloads the file, and writes information about all dependencies to its cache ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rikcon, 2015-12-18
@brud

https://getcomposer.org/doc/05-repositories.md#usi...
It says that it will work only if you have your SSH key from the repository.
The only requirement is the installation of SSH keys for a git client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question