在安装laravel框架,执行conmposer install命令出现以下错误:
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
When working with _public_ GitHub repositories only, head here to retrieve a token:
https://github.com/settings/tokens/new?scopes=&description=Composer+on+DESKTOP-U8G28GM+2024-06-06+0831
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to:
https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+DESKTOP-U8G28GM+2024-06-06+0831
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "C:/Users/Hm/AppData/Roaming/Composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden):
No token given, aborting.
You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"
In Git.php line 473:
Failed to execute git clone --mirror -- https://github.com/symfony/service-contracts.git C:/Users/Hm/AppData/Local/Composer/vcs/https---github.com-symfony-service-contracts.git/
Cloning into bare repository 'C:/Users/Hm/AppData/Local/Composer/vcs/https---github.com-symfony-service-contracts.git'...
fatal: unable to access 'https://github.com/symfony/service-contracts.git/': Empty reply from server
解决方法:
根据提示,登录Github账号,然后在浏览器中访问上图红色箭头指的地址,网页拉到最下方,点击生成token,即可解决改问题
文章评论(0)