npm install 显示错误,找不到 git [英] npm install shows error with git not found

查看:354
本文介绍了npm install 显示错误,找不到 git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在包 JSON 中添加了一些依赖项并尝试安装 npm,但它显示与 git not found 相关的错误:

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

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

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 路径相关的错误.检查这个 ls-remote 命令

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

这篇关于npm install 显示错误,找不到 git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆