title: Ionic cannot add android platform
body: <p>I am trying to add the android platform using the following command</p>
  
  <pre><code>ionic platform add android
  </code></pre>
  
  <p>I am presented with the following output:</p>
  
  <pre><code>Creating android project...
  
  module.js:340
      throw err;
            ^
      Error: Cannot find module 'which'
          at Function.Module._resolveFilename (module.js:338:15)
          at Function.Module._load (module.js:280:25)
          at Module.require (module.js:364:17)
          at require (module.js:380:17)
          at Object.&lt;anonymous&gt; (/Users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:27:13)
          at Module._compile (module.js:456:26)
          at Object.Module._extensions..js (module.js:474:10)
          at Module.load (module.js:356:32)
          at Function.Module._load (module.js:312:12)
          at Module.require (module.js:364:17)
      Error: /Users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: Command failed with exit code 8
          at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
          at ChildProcess.emit (events.js:98:17)
          at maybeClose (child_process.js:756:16)
          at Process.ChildProcess._handle.onexit (child_process.js:823:5)
  </code></pre>
  
  <p>I have set the PATH in my bash_rc file as such:</p>
  
  <pre><code>export PATH=/Users/user1/android-sdk-macosx/platform-tools:/Users/user1/android-sdk-macosx/tools:$PATH
  </code></pre>
  
  <p>Adding the iOS platform was simple; no problems there.</p>
  
  <p>I checked my Android SDK and everything seems to be up to date.
  I also tried reinstalling cordova with <code>sudo npm -g uinstall cordova</code> followed by  <code>sudo npm -g install cordova</code> </p>
  
  <p>I have checked that <code>npm</code>, <code>cordova</code>, and <code>ionic</code> have been installed globally.</p>