首页 > 开发工具 > composer > Composer安装时要求输入授权用户名密码是怎么回事

Composer安装时要求输入授权用户名密码是怎么回事

藏色散人
发布: 2021-06-15 11:28:42
转载
2468 人浏览过

下面由composer教程栏目给大家介绍关于Composer 安装时要求输入授权用户名密码的问题,希望对需要的朋友有所帮助!

1

2

3

4

5

6

7

8

9

D:\work\dreamland-yii>composer require "saviorlv/yii2-dysms:dev-master"

 

    Authentication required (packagist.phpcomposer.com):

      Username:

      Password:

 

 

  [Composer\Downloader\TransportException]

  Invalid credentials for &#39;https://packagist.phpcomposer.com/p/saviorlv/yii2-dysms%24045b85ee8f7a846caecdf82efa78fb4927e19868940b05fbb3ddb6383a10d41f.json&#39;, aborting.require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

登录后复制

需要改为中国的composer源,请求接口显示的“There is an arrear problem with this JSS account that prevents the operation from completing successfully” 翻译为:“此JSS帐户存在欠费问题,导致操作无法成功完成”.....

改用国内镜像源就好了 https://pkg.phpcomposer.com/

1

composer config -g repo.packagist composer https://packagist.phpcomposer.com

登录后复制

然后我这里又出现一个问题

1

2

3

4

5

6

7

8

9

D:\work\dreamland-yii>composer require "saviorlv/yii2-dysms:dev-master"

./composer.json has been updated

Loading composer repositories with package information

Updating dependencies (including require-dev)

 

Could not fetch https://api.github.com/repos/bestiejs/punycode.js/tags?per_page=100, please create a GitHub OAuth token to go over the API rate limit

Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+JL-HOST-008-PC+2018-10-13+0916

to retrieve a token. It will be stored in "C:/Users/niuben/AppData/Roaming/Composer/auth.json" for future use by Composer.

Token (hidden):

登录后复制

 它让我输入一个token???

经过网上查询 这是因为Composer 没有添加github密钥

解决方法

进入 https://github.com/settings/tokens 点击 「Generate new token」(记得先登录哦

新建一个 Token,输入描述,选择默认新建就行,然后就会得到一个 Token,然后把这个值粘贴过去就 OK 了。

 

以上是Composer安装时要求输入授权用户名密码是怎么回事的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
来源:csdn.net
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板