Node.js npm安装正在尝试从random fork安装

Node.js npm安装正在尝试从random fork安装,node.js,windows,git,npm,babun,Node.js,Windows,Git,Npm,Babun,我有一个节点项目,在mac上运行良好,但在家里的windows上,当我尝试进行npm安装时,它会给我一个访问权限错误 在我的package.json中 "dependencies": { "async": "2.1.4" } 它给了我这个错误 npm ERR! Command failed: git -c core.longpaths=true clone C:\Users\username\AppData\Roaming\npm-cache\_git-remotes\git-github

我有一个节点项目,在mac上运行良好,但在家里的windows上,当我尝试进行npm安装时,它会给我一个访问权限错误

在我的
package.json

"dependencies": {
  "async": "2.1.4"
}
它给了我这个错误

npm ERR! Command failed: git -c core.longpaths=true clone C:\Users\username\AppData\Roaming\npm-cache\_git-remotes\git-github-com-jstewmon-async-git-e757f9b4 C:\Users\username\.babun\cygwin\tmp\npm-17984-bd5d3a5c\git-cache-52562eee\c6a89a49b0d525c41545e8afd9a4fe844033cc52
npm ERR! Cloning into 'C:\Users\username\.babun\cygwin\tmp\npm-17984-bd5d3a5c\git-cache-52562eee\c6a89a49b0d525c41545e8afd9a4fe844033cc52'...
npm ERR! fatal: '/cygdrive/c/Users/username/AppData/Roaming/npm-cache/_git-remotes/git-github-com-jstewmon-async-git-e757f9b4/C:\Users\username\AppData\Roaming\npm-cache\_git-remotes\git-github-com-jstewmon-async-git-e757f9b4' does not appear to be a git repository
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
似乎正在尝试从async的分支安装。。我不明白

git-github-com-jstewmon-async-git-e757f9b4

我尝试了
npm clean cache
,但没有成功。

如中所述

我可以确认,在使用与Cygwin(2.4.5)64位绑定的当前git时,此命令失败“似乎不是git存储库”

当我单独下载和安装,并将
GIT\u HOME
放在
路径中
CYGWIN\u HOME
前面时,
npm安装
(包括
GIT克隆
)成功。
我安装了mintty选项,这样git也可以与docker一起正常工作

如果您不想在Windows上安装Git,可以改为执行以下操作:
“”
它涉及一个将被正确管理的,而不是像在
/cygdrive/c/../c:\Users\…
中那样盲目地连接它的

报告中提到了npm,即安装双Git的类似问题:

的沙盒git在通过npm使用时无法下载git回购。
要解决这个问题,您可以使用pact remove git卸载babun的git,并使用已经安装的git for Windows


尝试使用管理权限运行
npm install
命令
npm clean cache
之后,是否确认
C:\Users\username\AppData\Roaming\npm cache
为空?您可以尝试完全删除该文件夹。sudo和删除文件夹都不起作用。这是->但无论如何,谢谢,这让我找到了另一件事。@Devilwarriors很棒!我在回答中加入了你的评论,以提高可视性。修补后的git.js对我不起作用,我必须自己制作mods@GenePavlovsky很有趣。做得好。我现在使用WSL,所以我与Cygwin没有太多的交互。