2014-03-13 51 views
0

當我嘗試在Windows 7的目錄中安裝聚合物時出現錯誤。我安裝了NodeJS和bower。當我通過命令提示符進入該目錄並運行Polymer安裝命令時,它會引發此錯誤:「GIT未安裝或未安裝在路徑中。」bower ENOGIT git未安裝「。我安裝了GIT並將目錄添加爲庫。在目錄窗口上安裝聚合物時出現錯誤7

感謝, 山姆

回答

1

我這個第一個想到的是,你沒有git的爲%PATH%變量。

一切涼亭呢,據我瞭解的是,它會嘗試從github中獲取所需的東西,這意味着bower會在bower_components目錄中爲您解決項目問題..沒有進一步搜索給定的錯誤(「bower ENOGIT git is not installed」)我會說那個git在你的%PATH%變量中缺失,正如我已經提到的那樣。你可以通過打開一個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. 

我希望這個答案可以幫助你至少有一點

+0

我通過在環境變量的路徑變量中添加git來實現它。 –

1

添加路徑變量解決了該問題的環境。

1

它實際上只隱藏了更深的問題。就是說windows上的nodejs只會使用windows%PATH%環境變量來解析spawn的路徑。

這意味着,如果你是通過類似Cmder,使用bash在Windows下,那麼儘管在你的$ PATH /c/Program\ Files\ \(x86\)/Git/bin/c:\\Program\ Files\ \(x86\)\\Git\\bin,會的NodeJS找不到你的git的二進制文件,因爲它不看那裏,找你沒有運行shell暴露%P​​ATH%。

有趣的時代。 yay窗戶太棒了!