作曲家忽略auth.json

时间:2018-10-30 08:40:56

标签: authentication composer-php

即使我在$ COMPOSER_HOME中具有auth.json并已加载,composer仍然要求我在安装/更新时键入凭据。

这是composer update -vvv的输出,确认已加载auth.json

Reading ./composer.json
Loading config file /home/user/.config/composer/config.json
Loading config file /home/user/.config/composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html/api): git branch --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /home/user/.config/composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/html/api/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Running 1.6.3 (2018-01-31 16:28:17) with PHP 7.2.10-0ubuntu0.18.04.1 on Linux / 4.15.0-38-generic
Loading composer repositories with package information
Executing command (/home/user/.cache/composer/vcs/https---private.server.io-private-repo.git/): git rev-parse --git-dir
Executing command (/home/user/.cache/composer/vcs/https---private.server.io-private-repo.git/): git remote -v
Executing command (/home/user/.cache/composer/vcs/https---private.server.io-private-repo.git/): git remote set-url origin 'https://private.server.io/private/repo.git' && git remote update --prune origin
Username for 'https://private.server.io': 

这是我在/home/user/.config/composer/auth.json中的auth.json:

{
    "http-basic": {
        "private.server.io": {
            "username": "myUsername",
            "password": "myPassword"
        }
    }
}

我从可以工作的旧计算机复制了设置,但现在不行了。我已经删除了auth.json,并且作曲家问我是否要记住我的凭据,我说是的,但是没有任何效果。有任何想法如何使其正常工作吗?

2 个答案:

答案 0 :(得分:0)

如果您使用Ubuntu18.04,这是已知行为。但是,如果您每次输入时都要求输入用户名和密码,它将从auth.json中选择它们并完成作曲家的安装/更新。

答案 1 :(得分:0)

是,按enter即可。对于脚本,您可以设置环境变量GIT_ASKPASS=echo

相关问题