title: How to analyze Typescript project with SonarQube Scanner on Jenkins' Mac OS slave?
body: <p>I try to analyze a TypeScript project in Jenkins with SonarQube Scanner plug-in on a Mac OS slave. </p>
  
  <p><strong>Tools:</strong></p>
  
  <ul>
  <li>Jenkins (version 2.32.1)</li>
  <li><a href="https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins" rel="nofollow noreferrer">SonarQube Scanner for Jenkins</a> plug-in (version 2.5)</li>
  <li><a href="https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner" rel="nofollow noreferrer">SonarQube Scanner</a> (version 2.8)</li>
  <li><a href="https://wiki.jenkins.io/display/JENKINS/SSH+Slaves+plugin" rel="nofollow noreferrer">SSH slave</a> plug-in (version 1.12)</li>
  <li>SonarQube (version 6.7)</li>
  <li><a href="https://www.sonarsource.com/products/codeanalyzers/sonarts.html" rel="nofollow noreferrer">SonarTS</a> (version 1.1)</li>
  <li>Mac OS X (version 10.12.6)</li>
  </ul>
  
  <p><strong>Problem:</strong></p>
  
  <p>SonarTS plug-in tries to start <a href="https://nodejs.org/en/" rel="nofollow noreferrer">Node.js</a>, but Node.js is not in the <code>PATH</code> variable, see log:</p>
  
  <pre class="lang-none prettyprint-override"><code>Caused by: java.io.IOException: Cannot run program "node": error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
      at org.sonar.plugin.typescript.ExternalTypescriptSensor.executeExternalRunner(ExternalTypescriptSensor.java:175)
  </code></pre>
  
  <p><strong>Research:</strong> </p>
  
  <p>I tried to configure the path on Mac with:</p>
  
  <ul>
  <li><p><code>environment.plist</code> (from <a href="https://stackoverflow.com/a/15313578/5277820">https://stackoverflow.com/a/15313578/5277820</a>)</p>
  
  <p>but it doesn't work, because it is not supported anymore.</p></li>
  <li><p><code>/etc/launchd.conf</code> (from <a href="https://stackoverflow.com/a/15257454/5277820">https://stackoverflow.com/a/15257454/5277820</a>)</p>
  
  <p>but it doesn't work, because it is not supported anymore.</p></li>
  <li><p><code>/etc/paths.d/</code> (from <a href="https://apple.stackexchange.com/a/106549">https://apple.stackexchange.com/a/106549</a>)</p>
  
  <p>but it doesn't work (same error message).</p></li>
  </ul>
  
  <p>I tried to use the already added paths (<code>/usr/bin</code>, <code>/bin</code>, <code>/usr/sbin</code>, <code>/sbin</code>) with:</p>
  
  <ul>
  <li><p>symbolic link</p>
  
  <p>but it doesn't work, because the paths are write-protected (even for administrator). </p></li>
  </ul>
  
  <p>I tried to pass the path to the SonarQube Scanner:</p>
  
  <ul>
  <li><p>JVM option (from <a href="https://stackoverflow.com/a/21094766/5277820">https://stackoverflow.com/a/21094766/5277820</a>)</p>
  
  <p>but it doesn't work (same error message).</p></li>
  </ul>
  
  <p>I also read about changing path in the calling source:</p>
  
  <ul>
  <li><p><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html#environment--" rel="nofollow noreferrer"><code>ProcessBuilder#environment()</code></a> (from <a href="https://stackoverflow.com/a/5155791/5277820">https://stackoverflow.com/a/5155791/5277820</a>)</p>
  
  <p>but I didn't try it, because I don't want to patch the SonarQube Scanner source (for maintenance reasons). </p></li>
  <li><p><code>ProcessStarter#setGlobalSearchPath</code> (from <a href="https://stackoverflow.com/a/15206961/5277820">https://stackoverflow.com/a/15206961/5277820</a>)</p>
  
  <p>but I didn't try it, because I don't want to patch the SonarQube Scanner source (for maintenance reasons). </p></li>
  </ul>