Bahjaat
Bahjaat

Reputation: 101

composer update gives a 404 about a private repository metadata

I installed laravel/homestead and tried 'composer update'. Composer gives me an TransportException about a private repo.

Composer update
Loading composer repositories with package information
Your GitHub credentials are required to fetch private repository metadata (https://github.com/GrahamCampbell/asset)
A token will be created and stored in "/home/vagrant/.composer/auth.json", your password will never be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username:
Password:
Token successfully created
[Composer\Downloader\TransportException]
The "https://api.github.com/repos/GrahamCampbell/asset" file could not be downloaded (HTTP/1.1 404 Not Found)

I can't pass this point so I'm stuck.

Upvotes: 9

Views: 4192

Answers (1)

acfreitas
acfreitas

Reputation: 1397

If you have access to the private repo, you can use SSH Keys in composer.

Otherwise you can use GitHub API Tokens.

$ export GITHUB_ACCESS_TOKEN=hash-to-your-api-token
$ composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN
$ composer install

If you are using Vagrant, you can add an environment variable and the composer configuration in your provisioner.

At the moment of writing the page to generate a new access token on GitHub can be found under Settings / Developer settings / Personal access tokens.

Upvotes: 7

Related Questions