简体   繁体   English

npm install在具有git依赖项的Windows上不起作用

[英]npm install not working on windows with git dependencies

So, in my package.json I have, in dependencies, besides some npm modules, some private git repositories from my company: 因此,在我的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",
    .....
}

If i run npm install, it's working almost everywhere. 如果我运行npm install,它几乎可以在任何地方工作。 We mostly use Macs, but there's also another colleague running gitbash on windows and he has no problems with it. 我们主要使用Mac,但是还有另一位同事gitbash on windows运行gitbash on windows ,他对此没有任何问题。 I have a colleague with the same setup, windows and gitbash , that when we try to run npm install he gets the error: 我有一个具有相同设置的同事, windows and gitbash ,当我们尝试运行npm install他得到了错误:

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

Also, when we change #master to #commit-sha npm installs successfully, so it's not a problem with authentication or whatever. 另外,当我们将#master更改为#commit-sha npm安装成功,因此身份验证或其他任何问题都不成问题。

He is running Git for windows 1.9.4 and npm@latest (2.2.0). 他正在为Windows 1.9.4和npm @ latest(2.2.0)运行Git。

Any help will be much appreciated. 任何帮助都感激不尽。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM