【问题标题】:How Do I Install Specific Git Branch Using NPM?如何使用 NPM 安装特定的 Git 分支?
【发布时间】: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


    【解决方案1】:

    可能是因为指定项目中不存在该分支。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-05
    • 1970-01-01
    • 1970-01-01
    • 2012-12-20
    • 2016-04-19
    • 2017-02-17
    • 2021-12-29
    • 2018-05-02
    相关资源
    最近更新 更多