title: Nodejs Error: spawn git ENOENT when using simple-git to clone repo
body: <p>I am building an app that clones a repo, parses xml files in the repo and displays the information. I am using the simple-git npm module. I have this working on my local system, and on the dev test server. I am trying to deploy it to an integration server and this is the error I get. Some of the stuff I have seen says it is because the directory I'm attempting to clone to doesn't exist, but it most definitely does. </p>
  
  <p><a href="https://i.stack.imgur.com/ayVdl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ayVdl.png" alt="snip from console output"></a></p>
  
  <p>Here is the code I wrote to either clone the repo if it doesn't exists or pull pull the latest changes. This is a method of a class. this.path is the path to the directory the repo will be cloned to. this.repoRoot is the path to the root of the repo on the local system. this.remote is the url for the remote. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  /**
     * gets the latest version of the remote repo and specified branch by either using clone or pull
     * @return {Promise&lt;void&gt;}
     */
    getLatest() {
      return new Promise((resolve, reject) =&gt; {
        this.checkForDir(this.path).then((parentDirExists) =&gt; {
          if (!parentDirExists) {
            fs.mkdirSync(this.path);
          }
        }).then(() =&gt; {
          this.checkForDir(this.repoRoot).then((repoExistsLocally) =&gt; {
            if (!repoExistsLocally) {
              git(this.path).clone(this.remote).then((cloneResult) =&gt; {
                git(this.repoRoot).checkout(this.branch).then(() =&gt; {
                  resolve();
                });
              });
            }
            else {
              git(this.repoRoot).pull().then((pullResult) =&gt; {
                resolve();
              });
            }
          })
        })
      })
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance for any help!</p>