【发布时间】:2017-12-26 12:12:25
【问题描述】:
我在我的项目中使用Angular 2 Google Maps。有人创建了一个具有我需要的功能的分支。我想npm i那个分支而不是master。我在这里发现了一个问题告诉我如何操作(Install specific branch from github using Npm),它推荐以下格式:
npm install git://github.com/shakacode/bootstrap-loader.git#v1 --save
所以我尝试了:
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
我收到以下错误:
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>...]'
docs 似乎不包括安装分支。从错误来看,我似乎需要以某种方式指定修订号,我找不到有关如何执行此操作的信息。
TL;DR:我如何 npm i 一个特定的 repo 分支。
【问题讨论】:
标签: git github npm installation