npm install显示找不到git的错误

Har*_*C U 3 git npm angular angular7

在这里输入图像描述我最近向package.JSON添加了一些依赖项,并尝试安装npm。但它显示与git相关的错误,也找不到

npm ERR!路径git
npm错误!代码ENOENT
npm ERR!errno ENOENT
npm ERR!syscall生成git
npm ERR!enoent执行时出错:
npm ERR!enoent未定义ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR!enoent
npm ERR!enoent
npm ERR!enoent生成git ENOENT
npm ERR!enoent这与npm无法找到文件有关。npm ERR!enoent
npm ERR!可以在以下位置找到此运行的完整日志:

图片

Sae*_*ini 8

就我而言,我安装了 Git,但只能从 Git Bash 访问它(我在安装时选择了下面的第一个选项)。我用第二个选项重新安装,它解决了这个问题:

在此处输入图片说明

  • 同样在这里。并且不要忘记重新启动,否则 git 命令将在 cmd 中不可用。 (3认同)

Sha*_*vek 5

您需要将其安装git在计算机中才能正常工作。

undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
Run Code Online (Sandbox Code Playgroud)

应该是

git ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
Run Code Online (Sandbox Code Playgroud)

git路径相关的错误。检查此ls-remote命令