Errors encountered when running git related commands in the terminal or node.js:
Solution:
1. Find the path of bin in the git installation on your computer, such as: C:\Users\XXX\Git\Git\bin; at the same time, find the location of git-core in the git installation path, such as: C:\Users\XXX \Git\Git\libexec\git-core;
XXX is the system name;
2. Configure system variables. Right-click “Computer” -> “Properties” -> “Advanced System Settings” -> “Environment Variables” -> Find “path” in the “System Variables” below -> select “path” and select “Edit” -> Copy the bin and git-core paths found in 1 to the left. Save and exit.
Then re-run git, success!