Bower : ENOGIT git is not installed or not in the PATH

Posted zcynine

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Bower : ENOGIT git is not installed or not in the PATH相关的知识,希望对你有一定的参考价值。

全局安装bower

$ npm install -g bower

检测成功

$ bower help

在项目根目录下进行安装(最新版本),会自动生成一个bower_components文件夹(如果在cmd下会出bug就修改下环境变量,或者用git bash)

$ bower install jquery

列出已安装包列表

$ bower list

搜索包

$ bower search <package name>

查看包信息

$ bower info <package name>

使用bower init 命令来创建bower.json文件

$ bower init

生成如下json

{
  "name": "mynode",
  "description": "",
  "main": "",
  "authors": [
    "zcynine"
  ],
  "license": "MIT",
  "homepage": "",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "jquery": "^2.2.4",
    "bootstrap": "^3.3.6"
  }
}

 

 

 

 

================用cmd使用bower install时出现的bug==============

Bower : ENOGIT git is not installed or not in the PATH

解决方法一:

添加git到window的环境变量中。设置path路径为C:\Program Files\Git\bin

 

解决方法二:

$ set PATH=%PATH%;C:\Program Files\Git\bin

 

设置完后需要重启电脑以让变量生效。

以上是关于Bower : ENOGIT git is not installed or not in the PATH的主要内容,如果未能解决你的问题,请参考以下文章

Bower : ENOGIT git is not installed or not in the PATH

git更新失败Probably the path to Git executable is not valid

ERROR: Repository not found. ////Git, but is not registered in the Settings.

gitgit: ‘interpret-trailers’ is not a git command. See ‘git --help’

gitgit: ‘interpret-trailers’ is not a git command. See ‘git --help’

gitgit: ‘interpret-trailers’ is not a git command. See ‘git --help’