title: How to run npm scripts with WinPTY?
body: <p>I had the known issue of <a href="https://stackoverflow.com/questions/32597209/python-not-working-in-the-command-line-of-git-bash">python freezing in Git bash on windows</a>. Many answers on stackoverflow suggested to use <a href="https://github.com/rprichard/winpty/" rel="nofollow noreferrer">WinPTY</a>. </p>
  
  <p>Which works fine when I use:</p>
  
  <p><code>winpty python foo.py</code></p>
  
  <p>But I run a python program as part of a npm script. My package.json has this:</p>
  
  <pre><code>"scripts": {
    "start": "python foo.py &amp;&amp; something else"
  } 
  </code></pre>
  
  <p>So I figure I will need to run npm script with WinPTY too:</p>
  
  <p><code>winpty npm start</code></p>
  
  <p>But this is not working. I got different error messages on different environments. </p>
  
  <ol>
  <li>I got "Not found in PATH" at work which has latest git and npm installed, but <em>it is</em> in PATH:</li>
  </ol>
  
  <blockquote>
    <p>winpty: error: cannot start 'npm': Not found in PATH</p>
  </blockquote>
  
  <ol start="2">
  <li>I got a different error at my personal computer with a slightly older git:</li>
  </ol>
  
  <blockquote>
    <p>Error 0x2 starting npm start</p>
  </blockquote>
  
  <p>Any ideas why npm and winpty isn't working together? </p>
  
  <p>If I run <code>npm start</code> without winpty it works fine. <code>winpty node</code> works too.</p>