我有一个项目,希望在Linux上获得所有纱线依赖。当我使用
yarn install
我收到以下错误:
#yarn install
yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone http://example.org/git/my_example.git /usr/local/share/.cache/yarn/v1/.tmp/05a8813322130c7dd3080dc68b6c6680
Directory: /home/user/my_project
Output:
Clone to '/usr/local/share/.cache/yarn/v1/.tmp/05a8813322130c7dd3080dc68b6c6680' ...
fatal: could not read Username for 'http://example.org': terminal prompts disabled
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
最后的链接没有帮助。我搜索了一下并在执行命令之前设置了环境变量GIT_TERMINAL_PROMPT
:
env GIT_TERMINAL_PROMPT=1 yarn install
像这里提出的那样:go get results in 'terminal prompts disabled' error for github private repo
凭证缓存的使用不起作用,因为我没有克隆的存储库,这应该由纱线克隆。
但结果是一样的。我该怎么做才能解决这个问题呢?