title: Install npm module from gitlab private repository
body: <p>We are using <a href="https://gitlab.com/" rel="noreferrer">GitLab</a> for our private project. There are some forked libraries from github, that we want to install as npm module. Installing that module directly from npm is ok and for example this:</p>
  <pre><code>npm install git://github.com/FredyC/grunt-stylus-sprite.git
  </code></pre>
  <p>...works correctly too, but doing the same for GitLab, just changing domain gets me this error.</p>
  <pre><code>npm WARN `git config --get remote.origin.url` returned wrong result (git://git.domain.com/library/grunt-stylus-sprite.git)
  npm ERR! git clone git://git.domain.com/library/grunt-stylus-sprite.git Cloning into bare repository 'D:\users\Fredy\AppData\Roaming\npm-cache\_git-remotes\git-git-domain-com-library-grunt-stylus-sprite-git-6f33bc59'...
  npm ERR! git clone git://git.domain.com/library/grunt-stylus-sprite.git fatal:unable to connect to git.domain.com:
  npm ERR! git clone git://git.domain.com/library/grunt-stylus-sprite.git git.domain.com[0: 77.93.195.214]: errno=No error
  npm ERR! Error: Command failed: Cloning into bare repository 'D:\users\Fredy\App
  Data\Roaming\npm-cache\_git-remotes\git-git-domain-com-library-grunt-stylus-spr
  ite-git-6f33bc59'...
  npm ERR! fatal: unable to connect to git.domain.com:
  npm ERR! git.domain.com[0: xx.xx.xx.xx]: errno=No error
  </code></pre>
  <p>From the web interface of GitLab, I have this URL
  <code>git@git.domain.com:library/grunt-stylus-sprite.git</code>. Running this against <code>npm install</code> it tries to install <code>git</code> module from npm registry.</p>
  <p>However using URL: <code>git+ssh@git.domain.com:library/grunt-stylus-sprite.git</code> is suddenly asking me for the password. My SSH key doesn't include passphrase, so I assume it wasn't able to load that key. Maybe there is some configuration for that I have missed ? Key is located at standard location in my home directory with the name <code>&quot;id_rsa&quot;</code>.</p>
  <p>I am on Windows 7 x64.</p>
  <p><strong>UPDATE</strong></p>
  <p>Since NPM v3 there is built-in support for GitLab and other sources (BitBucket, Gist), from where you can install packages. It works for public and private ones so it's not exactly related to this, but some might find it useful.</p>
  <pre><code>npm install gitlab:&lt;gitlabname&gt;/&lt;gitlabrepo&gt;[#&lt;commit-ish&gt;]
  </code></pre>
  <p>Check out documentation: <a href="https://docs.npmjs.com/cli/install" rel="noreferrer">https://docs.npmjs.com/cli/install</a></p>
  <p>I you want to work with private repos in Gitlab you are required to manage your credentials/auth-token in your <code>.npmrc</code>. See here: <a href="https://docs.gitlab.com/ee/user/packages/npm_registry/#authenticate-to-the-package-registry" rel="noreferrer">https://docs.gitlab.com/ee/user/packages/npm_registry/#authenticate-to-the-package-registry</a></p>