当我尝试在Windows 7上的目录中安装聚合物时出现错误。我已经安装了NodeJS和bower。当我通过命令提示符进入目录并运行Polymer install命令时,它会抛出此错误:" GIT未在Path中安装或未安装。 "凉亭ENOGIT git未安装"。我安装了GIT并将目录添加为存储库。
谢谢, 萨姆
答案 0 :(得分:1)
我首先想到的是,你没有git作为%PATH%变量。
据我所知,所有的凉亭都会尝试从github获取所需的东西,这意味着bower在bower_components目录中为你克隆项目..没有进一步搜索给定的错误("凉亭)没有安装ENOGIT git")我说你已经提到的%PATH%变量中缺少git。你可以通过打开一个cmd并输入" git"来轻松测试它。在里面。预期结果应该是这样的:
$ git
usage: git [--version] [--help] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty Git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
我希望这个答案可以帮助你至少一点
答案 1 :(得分:1)
添加环境变量的路径解决了这个问题。
答案 2 :(得分:1)
它实际上只隐藏了更深层次的问题。这就是windows上的nodejs只会使用windows%PATH%环境变量来解析spawn的路径。
这意味着如果你通过像Cmder这样的东西在windows上使用bash,那么尽管你的$ PATH中有/c/Program\ Files\ \(x86\)/Git/bin/
或c:\\Program\ Files\ \(x86\)\\Git\\bin
,nodejs将找不到你的git二进制文件,因为它&#39;没有看那里,你没有运行暴露%PATH%的shell。