FredyC FredyC - 2 months ago 120x
Git Question

Install npm module from gitlab private repository

We are using GitLab 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:

npm install git:// correctly too, but doing the same for GitLab, just changing domain gets me this error.

npm WARN `git config --get remote.origin.url` returned wrong result (git://
npm ERR! git clone 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:// fatal:unable to connect to
npm ERR! git clone git://[0:]: errno=No error
npm ERR! Error: Command failed: Cloning into bare repository 'D:\users\Fredy\App
npm ERR! fatal: unable to connect to
npm ERR![0: xx.xx.xx.xx]: errno=No error

From the web interface of GitLab, I have this URL
. Running this against
npm install
it tries to install
module from npm registry.

However using URL:
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

I am on Windows 7 x64.


Since NPM v3 there is built-in support for GitLab and other sources (BitBucket, Gist), from where you can install packages. Unfortunately it works only for public ones so it's not exactly related to this, but some might find it useful.

npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]

Check out documentation:


I had the same issue using a private instance of GitLab. Taking from the existing answers you're able to use the privately hosted repositories with the following;