git与npm有什么关系? | npm ERR!使用git失败。 | material.angular.io [英] How does git relate with npm? | npm ERR! Failed using git. | material.angular.io

查看:13869
本文介绍了git与npm有什么关系? | npm ERR!使用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 (例如 PortableGit-2.14.2-64-bit.7z.exe $ b 然后我写一个小的 senv.bat 脚本,它将为我设置PATH,使用我需要的最小值,即:
$ b




我的问题是为什么我要在服务器上安装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:

  • a simplified PATH

     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屋!

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