git与npm有什么关系? | npm ERR!使用git失败。 | material.angular.io [英] How does git relate with npm? | npm ERR! Failed using git. | material.angular.io
问题描述
Angular 4 cli,我运行这个命令来安装Angular Material( npm install --save angular / material2-builds angular / cdk-builds ),但它显示如下错误: p>
npm ERR!在$ PATH
中找不到git二进制文件npm ERR!
npm ERR!使用git失败。
npm ERR!请检查您是否安装了git并且在PATH中。
在这种情况下,我必须在我的电脑中安装git,或者git与npm有什么关系?我该如何解决这个问题?无论如何,感谢大家。
我更喜欢使用 portable git (例如 PATH以您需要的最小值完成 PortableGit-2.14.2-64-bit.7z.exe $ c
$ b 然后我写一个小的 senv.bat
脚本,它将为我设置PATH,使用我需要的最小值,即:
$ b
set PATH =%PATH%; C:\path\to\\\
pm
我的问题是为什么我要在服务器上安装git?
这是官方 npm
文档的一部分:参见 No Git 。
npm
可能需要从远程Git仓库克隆依赖关系。
Angular 4 cli, I run this command to install Angular Material (npm install --save angular/material2-builds angular/cdk-builds) but it is showing an error as followS:
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
For this scenario, I have to install git in my PC or how is git related to npm? How can I solve this issue? Anyway thanks to everyone.
I prefer to use a portable Git (like PortableGit-2.14.2-64-bit.7z.exe
) I have uncompressed anywhere I want.
Then I write a small senv.bat
script that will set the PATH for me with the minimum I need, which is:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\ set GH=C:\path\to\git set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
a PATH completed with the minimum you need
set PATH=%PATH%;C:\path\to\npm
My question is why i want to install git in my server?
That is part of the official npm
documentation: see "No Git".
npm
can need to clone dependencies from remote Git repos.
这篇关于git与npm有什么关系? | npm ERR!使用git失败。 | material.angular.io的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!