node.js - npm install 显示错误,找不到 git

标签 node.js angular git npm angular7

我最近向 package.JSON 添加了一些依赖项并尝试安装 npm 。但它显示了与 git not found 相关的错误

Error Screenshot

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:



Image

最佳答案

您需要install git在你的机器上让它工作。

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 路径相关的错误。 check this ls-remote command

关于node.js - npm install 显示错误,找不到 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56473680/

相关文章:

javascript - 如何使用 Promises 执行后台异步任务

javascript - 如何在不转换为 Angular 中的字符串的情况下在多部分/表单数据请求中发送对象

node.js - Angular 2.0 深层链接不起作用。与地址栏相同

ruby - 坚固的存储库实例是线程安全的吗?

git - 如何在未安装 Git 的情况下应用 `git diff` 补丁?

javascript - 英石。如果请求中已经提供了 URI 的 'path' 部分,则跳过该部分

node.js - React 中删除请求

node.js - Firebase 提供 --only 功能,admin.auth() 在本地不起作用,除非我手动设置 key.json

javascript - Angular 4.0 http put 请求

git - Homebrew 安装的 gettext 和 git 不兼容?