3

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.

VSO
  • 11,546
  • 25
  • 99
  • 187

1 Answers1

3

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

enter image description here

BogdanC
  • 2,746
  • 2
  • 24
  • 22
  • The branch you are looking for is [https://github.com/jigfox/angular-google-maps/tree/add-clustered-markers](https://github.com/jigfox/angular-google-maps/tree/add-clustered-markers). The branch is in pull request on the main project. – BogdanC Jul 20 '17 at 18:14
  • Thanks, `npm i git://github.com/jigfox/angular-google-maps.git#add-clustered-markers --save` worked. – VSO Jul 20 '17 at 18:20