【问题标题】:npm install not working on windows with git dependenciesnpm install 无法在具有 git 依赖项的 Windows 上运行
【发布时间】:2015-01-20 19:51:29
【问题描述】:

所以,在我的 package.json 中,除了一些 npm 模块之外,我还有一些来自我公司的私有 git 存储库:

devDependencies": {
    "async": "^0.9.0",
    "build-tools": "git+ssh://git@github.com/mycompany/repo.git#master",
    "chai": "^1.9.2",
    "download": "^0.2.1",
    .....
}

如果我运行 npm install,它几乎可以在任何地方工作。 我们主要使用 Mac,但还有另一位同事在运行 gitbash on windows,他对此没有任何问题。 我有一位同事,windows and gitbash 的设置相同,当我们尝试运行 npm install 时,他得到了错误:

fatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree

此外,当我们将#master 更改为#commit-sha 时,npm 安装成功,因此身份验证或其他任何问题都不是问题。

他正在为 windows 1.9.4 和 npm@latest (2.2.0) 运行 Git。

任何帮助将不胜感激。

【问题讨论】:

    标签: node.js git npm


    【解决方案1】:

    显然清理了[USER]\AppData\Roaming\文件夹中的npm-cache,然后重新安装npm解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-12
      • 2018-08-17
      • 1970-01-01
      • 2017-11-24
      • 2016-04-02
      • 2018-07-25
      • 2017-10-01
      • 1970-01-01
      相关资源
      最近更新 更多