我有一个项目,想在 Linux 上使用 yarn 获取所有依赖项。当我使用
yarn install
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
#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.
Run Code Online (Sandbox Code Playgroud)
最后的链接没有帮助。GIT_TERMINAL_PROMPT在执行命令之前,我搜索了一下并设置了环境变量:
env GIT_TERMINAL_PROMPT=1 yarn install
Run Code Online (Sandbox Code Playgroud)
就像这里建议的那样:go get results in 'terminal prompts disabled' error for github private repo
凭据缓存的使用不起作用,因为我没有克隆存储库,这应该由纱线克隆。
但结果是一样的。我该怎么做才能解决这个问题?