【问题标题】:Error while trying to install an npm module from git尝试从 git 安装 npm 模块时出错
【发布时间】:2019-06-03 02:46:01
【问题描述】:

我在 Github 上分叉和模块,根据我的需要对其进行了更改并推回了 git。现在我正在尝试使用 npm 安装此模块

npm install git+http://github.com/username/modulename.git

但我收到以下错误:

npm ERR! Command failed: git submodule update -q --init --recursive npm ERR! fatal: O:/Programs/Git/mingw64/libexec/git-core\git-submodule cannot be used without a working tree.

什么可能导致它以及如何解决它?

【问题讨论】:

    标签: node.js git npm module


    【解决方案1】:

    检查这是否相似to this thread:

    经过一番调试,我确定如果我使用 url "https://github.com/nfroidure/ttf2woff2#master" 代替,这确实有效。
    这是因为它在做一个shallow clone,它不使用--mirror,所以不是一个裸仓库。

    所以在你的情况下:

    npm install "https://github.com/username/modulename.git#master"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-04
      • 1970-01-01
      • 2016-09-14
      • 2018-11-22
      • 1970-01-01
      相关资源
      最近更新 更多