git is not installed or not in the PATH

前端 未结 9 1185
天涯浪人
天涯浪人 2020-12-05 06:14

Windows, when I try to run npm install, it shows:

mean@1.0.0 postinstall E:\\mean
node node_modules/grunt-cli/bin/grunt install
Running \"bower:         


        
相关标签:
9条回答
  • 2020-12-05 06:49

    Use Git CMD instead of using Win CMD.

    0 讨论(0)
  • 2020-12-05 06:50

    Did you install Git correctly?

    According to the Bower site, you need to make sure you check the option "Run Git from Windows Command Prompt".

    I had this issue where Git was not found when I was trying to install Angular. I re-ran the installer for git and changed my setting and then it worked.

    enter image description here

    From the bower site: http://bower.io/

    0 讨论(0)
  • 2020-12-05 06:52

    I did install git and tried again and got the same error. But running 'npm install' in a new command prompt window worked for me. Restarting the machine is not required.

    0 讨论(0)
  • 2020-12-05 07:05

    Installing git and running npm install from git-bash worked for me. Make sure you are in the correct directory.

    0 讨论(0)
  • 2020-12-05 07:06

    If you installed GitHubDesktop then the path for git.exe will be ,

    C:\Users\<'Username'>\AppData\Local\GitHubDesktop\app-1.1.1\resources\app\git\cmd

    Add this path to the environment variables by following,

    ** (Note: \cmd at the end, not \cmd\git.exe).**

    Navigate to the Environmental Variables Editor and find the Path variable in the “System Variables” section. Click Edit… and paste the URL of Git to the end. Save!

    Now open a new cmd and type command git. If you are able to see the git usage then it's done.

    Now you can execute your command to install your package.

    ex: npm install native-base --save

    0 讨论(0)
  • 2020-12-05 07:07

    Go to Environmental Variables you will find this in Computer Properties->Advance system Setting->Environmental Variables -> Path

    Add the path of your git installed int the system. eg: "C:\Program Files\Git\cmd"

    Save it. Good to go now!!

    0 讨论(0)
提交回复
热议问题