title: Cordova / Ionic build error (sometimes): don't have required environment
body: <p>I have just started dabbling in Cordova / Ionic to make Android / iOS apps with HTML5 / js, and so far I have gotten sample / tutorial apps to work sometimes, but not every time.</p>
  
  <p>I am working on Windows and am trying to build my projects for Android for now.</p>
  
  <p>After a couple tries, I am no longer able to build my apps, even completely "blank" template apps that I did not change at all. I tried creating apps via Cordova</p>
  
  <pre><code>cordova create hello com.example.hello HelloWorld
  cd hello
  cordova build android
  </code></pre>
  
  <p>or Ionic</p>
  
  <pre><code>ionic start test sidemenu
  cd start
  ionic build android
  </code></pre>
  
  <p>In both cases I get the same error:</p>
  
  <pre><code>Running command: C:\Users\nthissen\Dropbox\Mobile\Projects\hello\platforms\andro
  id\cordova\build.bat
  events.js:85
        throw er; // Unhandled 'error' event
              ^
  Error: spawn cmd ENOENT
      at exports._errnoException (util.js:746:11)
      at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
      at child_process.js:1137:20
      at process._tickCallback (node.js:355:11)
  ERROR building one of the platforms: Error: C:\Users\nthissen\Dropbox\Mobile\Pro
  jects\hello\platforms\android\cordova\build.bat: Command failed with exit code 1
  
  You may not have the required environment or OS to build this project
  </code></pre>
  
  <p>Yes, I do have the Android SDK and everything installed. The strange thing is: when I restart my computer and try it immediately, <strong>it works without problems</strong> and I'm even able to emulate / run the app. After a couple more tries, edits to the source code, etc (I am not quite sure what's causing it), it stops working and I cannot even build a newly created project anymore.</p>
  
  <p>What's going on? Why does it work right after a reboot, but stops working for seemingly random reason?</p>