admin管理员组文章数量:1245107
When attempting to install the dependencies for my project with Yarn via yarn install
, the process (and progress bar indicator) hangs when attempting to fetch packages. A timeout never occurs and the --verbose
option gives no useful clues regarding the cause of the problem.
CentOS 7
Yarn version: 0.27.5
When attempting to install the dependencies for my project with Yarn via yarn install
, the process (and progress bar indicator) hangs when attempting to fetch packages. A timeout never occurs and the --verbose
option gives no useful clues regarding the cause of the problem.
CentOS 7
Yarn version: 0.27.5
Share Improve this question asked Jul 9, 2017 at 20:30 user3006381user3006381 2,8853 gold badges25 silver badges33 bronze badges2 Answers
Reset to default 5This issue is caused by the bination of the older version of Git installed by Yum on CentOS (1.8.3.1-6 at the time of this writing) and Git's two-factor authentication mechanism.
Git's 2FA is the reason the hanging occurs in the first place, since one of the packages Yarn was attempting to fetch was a private repo via HTTPS (see here for details).
The version of the Git client in CentOS turned out to be the reason the hanging continued to occur and never timed / erred out. That is, the aforementioned version of Git on CentOS prevented Yarn from recognizing the authentication error and exiting accordingly.
The solution is to upgrade Git to a more recent version using a different repo:
sudo yum -y erase git
sudo rpm -U http://opensource.wandisco./centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
sudo yum -y install git
This will stop Yarn from continuing to hang, with an output similar to the following:
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
...
fatal: could not read Username for 'https://github.': terminal prompts disabled
My coworker and I had a similar issue and it was hanging because the vpn had disconnected. So double check your vpn is connected.
本文标签: javascriptWhy does yarn install hang when fetching packages on CentOSStack Overflow
版权声明:本文标题:javascript - Why does `yarn install` hang when fetching packages on CentOS? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740227661a2244992.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论