node.js - 尝试从 git 安装 npm 模块时出错
问题描述
我在 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.
什么可能导致它以及如何解决它?
解决方案
检查这是否类似于此线程:
经过一番调试,我确定如果我使用 URL“ https://github.com/nfroidure/ttf2woff2#master ”,这实际上是可行的。
这是因为它正在做一个不使用的浅克隆--mirror
,所以它不是一个裸存储库。
所以在你的情况下:
npm install "https://github.com/username/modulename.git#master"
推荐阅读
- python - pandas groupby 应用/转换操作以对每个组进行操作
- c# - 具有多个“子引用”的断开连接的实体指向同一个已经存在的实体
- database - 表单值不会存储到我的 SQLite 数据库中,但其他值会
- html - 为什么 html 不能一致地右对齐和设置单元格中的数字样式
- visual-studio - Android Wearable Emulator 设置失败 - Visual Studio
- python - Numpy 使用 genfromtext 解析日期
- java - 为什么 Mac 上的 Scala 在 unicode 目录中运行时会失败
- oracle - Oracle:表或视图不存在
- javascript - 将变量记录到控制台
- java - 如何为 Google Cloud Bigtable 进行连接池