php - Composer 隐藏 token

标签 php windows github composer-php

每次更新 composer 时,我都必须输入一个在 github 上生成的 Token。
我用 this plugin安装凉亭包。

这发生在 github.com/RamonSmit/Netable.git 成为私有(private)仓库之后。
我删除了对这个 repo 的所有引用。

但我仍然收到消息:

Your GitHub credentials are required to fetch private repository metadata (git://github.com/RamonSmit/Nestable.git)

Head to https://github.com/settings/tokens/new?scopes=repo&description=... to retrieve a token. It will be stored in "..." for future use by Composer. Token (hidden):

我将 composer 和 composer-asset-plugin 更新到最新版本并清除了缓存。

这也行不通:

composer config --global github-oauth.github.com xxx

我怎样才能摆脱这个不必要的消息?

composer diag 的输出:

Checking composer.json: FAIL
require.yiisoft/yii2 : unbound version constraints (>=2.0.6) should be avoided
require.yiisoft/yii2-bootstrap : unbound version constraints (*) should be avoided
require.yiisoft/yii2-swiftmailer : unbound version constraints (*) should be avoided
require.fishvision/yii2-migrate : unbound version constraints (*) should be avoided
require.infoweb-internet-solutions/yii2-cms : unbound version constraints (*) should be avoided
require.bower-asset/matchHeight : unbound version constraints (@stable) should be avoided
require.infoweb-internet-solutions/yii2-news : unbound version constraints (*) should be avoided
require.infoweb-internet-solutions/yii2-action : unbound version constraints (*) should be avoided
require.infoweb-internet-solutions/yii2-member : unbound version constraints (*) should be avoided
require.dragonjet/yii2-opengraph : unbound version constraints (*) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: xxx
Dev Public Key Fingerprint: xxx
OK
Checking composer version: OK

auth.json:(位于C:\Users\User\AppData\Roaming\Composer)

{
    "github-oauth": {
        "github.com": "xxx"
    },
    "http-basic": {
        "bitbucket.org": {
            "username": "xxx",
            "password": "xxx"
        }
    }
}

composer 全局显示 -i

Changed current directory to C:/Users/Ruben/AppData/Roaming/Composer
fxp/composer-asset-plugin v1.1.1 NPM/Bower Dependency Manager for Composer

Composer .json:

{
  "name": "yiisoft/yii2-app-advanced",
  "description": "Yii 2 Advanced Project Template",
  "keywords": [
    "yii2",
    "framework",
    "advanced",
    "project template"
  ],
  "homepage": "http://www.yiiframework.com/",
  "type": "project",
  "license": "BSD-3-Clause",
  "support": {
    "issues": "https://github.com/yiisoft/yii2/issues?state=open",
    "forum": "http://www.yiiframework.com/forum/",
    "wiki": "http://www.yiiframework.com/wiki/",
    "irc": "irc://irc.freenode.net/yii",
    "source": "https://github.com/yiisoft/yii2"
  },
  "minimum-stability": "dev",
  "require": {
    "php": ">=5.4.0",
    "yiisoft/yii2": ">=2.0.6",
    "yiisoft/yii2-bootstrap": "*",
    "yiisoft/yii2-swiftmailer": "*",
    "fishvision/yii2-migrate": "*",
    "infoweb-internet-solutions/yii2-cms": "*",
    "bower-asset/matchHeight": "@stable",
    "infoweb-internet-solutions/yii2-news": "*",
    "infoweb-internet-solutions/yii2-action": "*",
    "infoweb-internet-solutions/yii2-member": "*",
    "dragonjet/yii2-opengraph": "*",
    "infoweb-internet-solutions/yii2-image-gallery": "*"
  },
  "require-dev": {
    "yiisoft/yii2-codeception": "*",
    "yiisoft/yii2-debug": "*",
    "yiisoft/yii2-gii": "*",
    "yiisoft/yii2-faker": "*"
  },
  "config": {
    "process-timeout": 1800,
    "preferred-install": "source"
  },
  "extra": {
    "asset-installer-paths": {
      "npm-asset-library": "vendor/npm",
      "bower-asset-library": "vendor/bower"
    }
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/infoweb-internet-solutions/yii2-i18n-module"
    },
    {
      "type": "vcs",
      "url": "https://github.com/infoweb-internet-solutions/yii2-ckeditor"
    },
    {
      "type": "vcs",
      "url": "git@bitbucket.org:infoweb-internet-solutions/yii2-news.git"
    },
    {
      "type": "vcs",
      "url": "git@bitbucket.org:infoweb-internet-solutions/yii2-action.git"
    },
    {
      "type": "vcs",
      "url": "git@bitbucket-infoweb:infoweb-internet-solutions/yii2-member.git"
    }
  ]
}

composer.lock

最佳答案

你应该在 github 上生成新的 token

Settings \ Developer settings \ Personal access tokens

关于php - Composer 隐藏 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35405128/

相关文章:

c# - 如何使用您的应用程序打开 jpg 文件?

windows - 从自定义 URL 处理程序启动 .bat 文件而不显示控制台窗口

c# - 如何获取已登录的本地 Windows 用户列表?

php - 从 php 增加数据库值(value)?

php - 如何在 PHP/MySQL 中创建表单以将允许的 IP 添加到网站?

ubuntu - MV : cannot stat './temp' : No such file or directory on github actions

github - 无法在 github 存储库上启用 fork

git - 在 github 中查看用户的全部事件

php hex to dec with math functions 返回不同的结果

PHP 如何在 Firebase 的表中添加/插入表