Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install node module from own gitlab server

I'd like to install node modules from our gitlab server. This is a link to a repository:

http://ABCD-GITLAB/myGroup/myNodeModule.git

According to the npm install guide the install command should be this:

gitlabUser: me
myProject: myNodeModule
npm install gitlab:mygitlabuser/myproject

I have no idea how to reference my

  • gitlab server url
  • group
  • project
  • account name

I tried some commands but all failed:

npm install gitlab:ABCD-GITLAB:me/myproject
npm install gitlab:ABCD-GITLAB:me/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myproject
npm install gitlab:http://ABCD-GITLAB:me/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject.git
npm install gitlab:http://ABCD-GITLAB:me/myGroup/myproject.git

What is the correct way to reference a npm dependency, a clear structure would be great like

npm install gitlab:<serverUrl/>:<username/>/<groupname/>/<projectname/><gitsuffix>.git
like image 998
marcel Avatar asked Mar 13 '26 11:03

marcel


1 Answers

I would try one of these:

npm install git+ssh://git@ABCD-GITLAB:myGroup/myNodeModule.git
npm install git+https://git@ABCD-GITLAB/myGroup/myNodeModule.git
npm install git://ABCD-GITLAB/myGroup/myNodeModule.git

You may need to change git to your username and you can add #v1.0.27 or something like that at the end for a specific version or tag:

npm install git://ABCD-GITLAB/myGroup/myNodeModule.git#v1.0.27

You can also install from a tarball:

npm install https://ABCD-GITLAB:myGroup/myNodeModule/repository/archive.tar.gz

You can add ?ref=master to the end of the tarball URL for the branch.

like image 84
rsp Avatar answered Mar 16 '26 03:03

rsp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!