9

我安装了 laravel/homestead 并尝试了“ composer update ”。Composer 给了我一个关于私人仓库的 TransportException。

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)

我无法通过这一点,所以我被卡住了。

4

1 回答 1

7

如果您有权访问私有存储库,则可以在composer中使用SSH 密钥

否则你可以使用GitHub API Tokens

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

如果你使用 Vagrant,你可以在你的配置器中添加一个环境变量和 composer 配置。

在编写页面以在 GitHub 上生成新的访问令牌时,可以在Settings / Developer settings / Personal access tokens下找到。

于 2015-03-30T12:39:58.037 回答