Search code examples
gitnpmbower

npm and bower updates fail majority of the time depending on the network


I am having issues both with bower and npm when I perform npm update.

jrquick$ npm update
npm ERR! git fetch -a origin (ssh://[email protected]/[PRIVATE_PROJECT]/[PRIVATE_REPOSITORY].git) ssh_exchange_identification: read: Connection reset by peer
npm ERR! git fetch -a origin (ssh://[email protected]/[PRIVATE_PROJECT]/[PRIVATE_REPOSITORY].git) fatal: Could not read from remote repository.
npm ERR! git fetch -a origin (ssh://[email protected]/[PRIVATE_PROJECT]/[PRIVATE_REPOSITORY].git) 
npm ERR! git fetch -a origin (ssh://[email protected]/[PRIVATE_PROJECT]/[PRIVATE_REPOSITORY].git) Please make sure you have the correct access rights
npm ERR! git fetch -a origin (ssh://[email protected]/[PRIVATE_PROJECT]/[PRIVATE_REPOSITORY].git) and the repository exists.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "update"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.8
npm ERR! code 128

npm ERR! Command failed: git fetch -a origin
npm ERR! ssh_exchange_identification: read: Connection reset by peer
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jrquick/[PRIVATE_PROJECT]/[PRIVATE_REPOSITORY]/npm-debug.log

When running from my work's network connection it fails with this error a majority of them time. However, I can go to Starbucks or my apartment and run the same command successfully.

Any ideas on how to fix this? I do not have any control over the network but I thought maybe changing packet sizes or some type of setting within git or npm to avoid this.

Thanks.


Solution

  • If this is a throttle issue, as mentioned by John D., the theoretical solution (as mentioned in "GitLab, NPM, and SSHd MaxStartups") would be to increase the MaxStartups value of the sshd configuration of the server.

    Since it is bitbucket.org, you don't have access to that configuration, of course.

    Another workaround would be to see if the issue persists when using https instead of ssh (and using automatically your credentials, cached by a credential helper)

    git config --global url."https://bitbucket.org/".insteadOf [email protected]: