Install npm module from gitlab private repository

前端 未结 9 1781
孤城傲影
孤城傲影 2020-11-28 01:31

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

相关标签:
9条回答
  • 2020-11-28 02:27

    You have the following methods for connecting to a private gitlab repository

    With SSH

    git+ssh://git@git.mydomain.com:Username/Repository#{branch|tag}
    git+ssh://git@git.mydomain.com/Username/Repository#{branch|tag}
    

    With HTTPS

    git+https://git@git.mydomain.com/Username/Repository#{branch|tag}
    

    With HTTPS and deploy token

    git+https://<token-name>:<token>@gitlab.com/Username/Repository#{branch|tag}
    
    0 讨论(0)
  • 2020-11-28 02:27

    None of the other answers worked for me for a private gitlab.com repo...

    This works however:

    npm i -S git+ssh://git@gitlab.com:<org>/<project>.git

    Its just the git ssh clone url from the project page's "clone" input field with git+ssh:// added to the front of it.

    0 讨论(0)
  • 2020-11-28 02:27

    As far as I can tell where you're going wrong is the git:// protocol. GitLab only supports HTTP(s) and SSH for clones. So you must use one of those methods instead of the git protocol.

    0 讨论(0)
提交回复
热议问题