# Git 报错:The unauthenticated git protocol on port 9418 is no longer supported.

在执行 yarn install 的时候,有些包调用了 git 命令 git ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git ,然后报错提示

fatal: remote error: The unauthenticated git protocol on port 9418 is no longer supported. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

解决方案:

这是因为 git:// 这种协议去获取远程分支无效了,需要使用其他协议,如 https://

设置 git 配置文件,把 git:// 自动换成 https://

git config --global url."https://".insteadOf git://

参考文章:

yarn install 提示:The unauthenticated git protocol on port 9418 is no longer supported. (opens new window)

The unauthenticated git protocol on port 9418 is no longer supported.的解决方法 (opens new window)