You can clone with
HTTPS or Subversion.
We are overloading our git repos to have different modules on different branches. This wasn't an issure until recently when I upgraded npm to the latest. If you repeatedly run npm install it eventually runs correctly.
npm WARN package.json firstname.lastname@example.org No README.md file found!
npm ERR! git fetch -a origin (https://OUTAUTHTOKENHERE:@github.com/USERNAME/repo) error: Ref refs/heads/error is at 83df736dcf06ea3099895f9cfc01a521ddcff580 but expected 754d8ade90831e6b737d1dedd706f91de31623d3
npm ERR! git fetch -a origin (https://OUTAUTHTOKENHERE:@github.com/USERNAME/repo) From https://github.com/USERNAME/repo
npm ERR! git fetch -a origin (https://OUTAUTHTOKENHERE:@github.com/USERNAME/repo) ! 754d8ad..83df736 error -> error (unable to update local ref)
npm ERR! git fetch -a origin (https://OUTAUTHTOKENHERE:@github.com/USERNAME/repo) error: Ref refs/heads/fetch is at 592a436b06d4b9f592a095573e04429ddd55b6b0 but expected 003726ce720c9d0c91abc02e91420559e4961baa
npm ERR! git fetch -a origin (https://OUTAUTHTOKENHERE:@github.com/USERNAME/repo) ! 003726c..592a436 fetch -> fetch (unable to update local ref)
It looks like git fetch -a origin is failing. Plesae cd into ~/.npm/_git-remotes. In there you'll find some folders. One of them will have a name that looks like the git remote you're pulling. It's a bare git clone. cd into there, and run git fetch -a origin. Does it work?
git fetch -a origin
I believe it is working, there is no output and a new command prompt comes up.
it appears to be consistent/deterministic and not a race condition -- the issue boils down to needing that folder to exist. The same folder is reused for mutliple modules that are in the same repo but scoped into different branches.
Can you please make something public that I can reproduce this with?
rm -rf node_modules && npm install
rm -rf ~/.npm/_git-remotes && npm install
Heroku has updated their npm for deploys to be 1.2 so I am having issues when I try to deploy to heroku now too.
you can mitigate the problem on heroku by setting npm to 1.1.x ... less than ideal though
I'm having the same issue :( Downgrading to 1.1.x works for me as well.
Does Heroku support more up to date versions of node/npm?
npm 1.2 has been out since January. Have they been able to upgrade yet?
Duplicate of #6469
It's possible that this is a regression, but we'll track it on #6469.