npm install显示找不到git的错误

npm install显示找不到git的错误

问题描述:

我最近向package.JSON添加了一些依赖项,并尝试安装npm.但显示与找不到git相关的错误

I have recently added some dependencies to the package.JSON and tried installing npm . but it shows errors related to git not found

错误屏幕截图

npm ERR!路径git
npm ERR!代码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!可以在以下位置找到此运行的完整日志:

npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
npm ERR! A complete log of this run can be found in:

图片

您需要安装 git使其正常工作.

You need to install git in your machine to have it working.

undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git

应该已经

git ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git

存在与git path相关的错误. 选中此ls-remote命令

There is error related to git path. check this ls-remote command