扣丁书屋

Go get命令出现terminal prompts disabled解决

处理错误提示:fatal: could not read Username for 'https://github.com': terminal prompts disabled

错误长这样

ubuntu@ubuntu:~$ go get -u github.com/XXX/OOOO/
# cd .; git clone https://github.com/XXX/OOOO/ /home/ubuntu/.go/src/github.com/XXX/OOOO/
Cloning into '/home/ubuntu/.go/src/github.com/maoxs2/Proj_Ridal'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
package github.com/XXX/OOOO/: exit status 128

原因go get disable "terminal prompt" by default(Go get 命令默认禁用terminal prompt,即终端提示)

解决方案:环境设置GIT_TERMINAL_PROMPT=1

export GIT_TERMINAL_PROMPT=1
go get XXX

最多阅读


手机扫码阅读