Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm install hangs for several minutes due to git ls-remote git:// url scheme #1673

Closed
xiata opened this issue Aug 13, 2020 · 5 comments
Labels
Bug thing that needs fixing Release 6.x work is associated with a specific npm 6 release

Comments

@xiata
Copy link

xiata commented Aug 13, 2020

Current Behavior:

During install, the following command fails repeatedly on CentOS 8.2 boxes, but not macOS:

git ls-remote -h -t git://github.com/DABH/diagnostics.git

The git:// protocol handler should not be used with git commands, even if npm supports it. You're asking for trouble using protocol handlers that may be doing something special for the underlying operating system (e.g. vfs).

This was caught while watching npm -ddd install --only=prod --no-audit

I noticed this issue because on my macOS machine, npm install takes 32 seconds, while on my CentOS 8.2 box, it was taking 12 minutes.

Expected Behavior:

During install, the following command to be run instead:

git ls-remote -h -t git@github.com:DABH/diagnostics.git

Steps To Reproduce:

npm install winston@3.3.1

Note: I found that they fixed the dependency not to require git in 3.3.2, but that just masks the underlying bug in npm.

WORK AROUND:

If you have to keep using packages that may depend on a git url, add to ~/.gitconfig or /etc/gitconfig:

[url "git@github.com:"]
  insteadOf = git://github.com/

Environment:

OS: CentOS 8.2.2004
Node: 10.21.0
NPM: 6.14.4

@darcyclarke darcyclarke added Bug thing that needs fixing Release 6.x work is associated with a specific npm 6 release Needs Triage needs review for next steps labels Aug 14, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Feb 13, 2021
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

1 similar comment
@darcyclarke
Copy link
Contributor

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

@drone1
Copy link

drone1 commented Jun 2, 2022

Oh my god, thank you @xiata -- modifying my ~/.gitconfig fixed this annoying hanging issue for me! Thank you!

If you have a moment, can you explain what this actually does so that I can understand better?

[url "git@github.com:"]
  insteadOf = git://github.com/

Thank you again.

@lmmfranco
Copy link

@xiata Thank you so much for the workaround!

@theosp
Copy link

theosp commented Aug 25, 2022

Solved the issue for me as well.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 6.x work is associated with a specific npm 6 release
Projects
None yet
Development

No branches or pull requests

5 participants