authentication - 作曲家忽略 auth.json
问题描述
即使我的 $COMPOSER_HOME 中有 auth.json 并且它已加载,作曲家仍然要求我在安装/更新时输入凭据。
这是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 并且作曲家问我是否希望它记住我的凭据,我说是的,但没有任何效果。任何想法如何让它工作?
解决方案
如果您使用相同的,这是 Ubuntu18.04 中的已知行为。但是,如果您只是在enter
每次询问用户名和密码时点击,它将从 auth.json 中选择它们并完成作曲家安装/更新。
推荐阅读
- javascript - 无法使用 chrome 扩展中的内容脚本触发活动网页上的事件
- php - 如何在 PhpStorm 中导航到 PHP 关键字源代码?
- python-3.x - 单击带有 Selenium 的 Material Sortable Header
- scala - 如何在 Scala 的解析器组合器中指定重复范围?
- python-3.x - 每个循环都用不同的数字替换出现
- java - 将形状移动到我的手指触摸的位置
- java - 即使重启Tomcat也不能更新类
- amazon-web-services - 为 AWS Cognito + API Gateway + Lambdas + DynamoDB + SNS 创建 CI 管道的最佳实践
- python - 关于anaconda环境中的python模块
- python - 使用 docx 包删除表格单元格中的第一行