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

Already on GitHub? Sign in to your account

npm install hangs on a private repository + branch #3889

erunion opened this Issue Sep 12, 2013 · 21 comments


None yet

erunion commented Sep 12, 2013

So I'm working with some private repositories that I want to pull in via npm. This is my dependencies array:

"dependencies": {
    "repo-name": "git+ssh://git@github.com:privateUsername/repo-name.git#develop"

Running an npm install with this, npm just hangs indefinitely (I sat there for 10 minutes waiting for it to do something). Removing #develop, it runs just fine.

Any ideas as to what's up?


luk- commented Sep 12, 2013

What version of node and npm?

erunion commented Sep 12, 2013

node: v0.10.16
npm: 1.3.3

rprieto commented Mar 6, 2014

@jonursenbach did you make any progress on this? We started seeing a similar behaviour today. In our case it looks like npm actually downloads everything (the app can start fine), but it hangs forever at the end, with .lock files sticking around for these git+xxx modules.

erunion commented Mar 6, 2014

@rprieto Nope, I didn't get anywhere with it and ended up just writing a small git clone wrapper to pull the repository down into node_modules/. Not particularly ideal, but npm just didn't want to install it at all.

rprieto commented Mar 6, 2014

Does it mean you don't specify your private dependencies in the package.json, and clone them instead?

For anyone reading this, I posted more details regarding our issue in this gist. It happens even on a brand new folder with a single git+https dependency.


  • CentOS 6.5
  • Hosted in Sydney Australia
  • Node 0.10.25
  • Tested on npm 1.3.6 and 1.4.4

erunion commented Mar 7, 2014

@rprieto Yeah, they don't exist in package.json at all and are instead just being cloned (albeit, directly into node_modules/ so they can be used with other modules).

I am unable to get npm install to work with a git+https dependency to a private github repo in my package.json either. I have no username or password credentials in package.json so as to not check in credentials, and have found that npm install first hangs on username/password prompts. The prompt for username is swallowed by npm and does not appear on the console, but it seems apparent that is what first causes it to hang as once I enter a user name, a prompt for a password ("Password for 'https://mike-lang@github.com':") does appear. However, npm continues to do nothing after entering the appropriate password.

I'm running:

  • Node 0.8.26
  • npm 1.3.12

Has anyone made any progress on this?

It appears an earlier failed run of npm install had put my system in an invalid state. Once I knew about the obscured prompts for credentials, I was able to get this to work by going into ~/.npm and clearing out any lingering .lock files.

I tried these workarounds and I still get a hang with any "git+ssh://git@github.com:..." reference. I'm running:

OS: Linux precise64 3.2.0-23-generic #36-Ubuntu
Node: v0.10.28
NPM: 1.4.9

Any workarounds?


lxe commented Sep 19, 2014

Do you have Control* attributes configured in ~/.ssh/config? Disable ControlMaster, ControlPath, etc..
And see if that resolves it. Also are you proxying/tunneling your ssh connection through anything?


smikes commented Feb 18, 2015

Is this still a problem for you?

The handling of git credentials has been improved a bit in current versions of npm -- can you update your npm to the latest version and check if the problem persists?

Have you looked into using a credential cache http://git-scm.com/docs/git-credential-cache to hold your git https credentials?

We are trying to clean up older npm issues, so if we don't hear back from you within a week, we may close this issue. (Don't worry -- you can always come back again and open a new issue!)


I can't say if the original problem remains. I switched over to SSH using ssh-agent and ssh-add together with a private key and haven't had any problems with it.


othiym23 commented Feb 19, 2015

So the original issue should have been resolved a while ago (and also, thanks to the fallbacks in the GitHub caching code, you should be able to use GitHub shortcut syntax in package.json to depend on private repositories), I'm going to close this as resolved.

@othiym23 othiym23 closed this Feb 19, 2015

erunion commented Feb 19, 2015

I can confirm my original issue no longer exists.

e-oz commented Mar 1, 2016

Experiencing this issue, npm 3.6.0, node v5.5.0, OS X 10.11.2. If somebody knows workaround - fix - please let me know.

Happening the same

Node 5.7.0
Npm 3.6.0
Ubuntu Server 14

Running npm install angular/angular#buid-js hangs, same happens with npm install git://github.com/angular/angular.git#build-js

No log nor anything. Anyway to debug this?

suluke commented Apr 27, 2016

I am running npm i --save-dev git+https://git@github.com:twbs/bootstrap.git#v4-dev (also without #v4-dev) and get stuck at normalizeTree -> fetchOth. This also happened on the machines of 2 of my colleagues, we're all running Arch Linux with npm version 3.8.7 and node 5.11.0.

suluke commented Apr 27, 2016

@e-oz we currently work around this issue by using the github-provided tarballs, like e.g. https://github.com/twbs/bootstrap/tarball/v4-dev. Maybe your git hosting solution provides something similar?

@othiym23 would you mind to re-open this issue? This is still happening (one year after the issue was closed).

@suluke your workaround works perfectly! Thank you so much!

For me, the indefinite hanging was caused by git-credential-cache prompting for my credentials in the background. I don't require the credential cache so I resolved the issue by editing my git global config (git config --global --edit) and removing the [credential] settings

ponelat commented May 22, 2017

I had a similar issue ( npm appeared to hang ), but in my case. It was due to the size of a https://github.com/xxx/xxx#aaa dependency. npm seemed to have cloned the entire repo, which took ages, and didn't have any indication. I fixed by using the tarball approach ( thanks @suluke ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment