Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Install Specific Git Branch Using NPM?

I am using Angular 2 Google Maps in my project. Someone created a branch that has the functionality I need. I would like to npm i that branch instead of master. I found a question telling me how to do it here (Install specific branch from github using Npm), which recommends the following format:

npm install git://github.com/shakacode/bootstrap-loader.git#v1 --save

So I tried:

npm i git://github.com/SebastianM/angular-google-maps.git#add-clustered-markers --save
npm i git://github.com/SebastianM/angular-google-maps.git#inovex:add-clustered-markers --save

I get the following error:

npm ERR! Command failed: git -c core.longpaths=true rev-list -n1 add-clustered-markers
npm ERR! fatal: ambiguous argument 'add-clustered-markers': unknown revision or path not in the working tree.
npm ERR! Use '--' to separate paths from revisions, like this:
npm ERR! 'git <command> [<revision>...] -- [<file>...]'

The docs don't seem to cover installing branches. From the error, it seems that I need to specify the revision number somehow, I can't find information on how to do that.

TL;DR: How do I npm i a specific repo branch.

like image 491
VSO Avatar asked Dec 09 '25 11:12

VSO


1 Answers

Maybe because that branch does not exist in the specified project.

enter image description here

like image 67
BogdanC Avatar answered Dec 11 '25 01:12

BogdanC



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!