title: Ionic2 build for iOs fails
body: <p>I am trying to set up an Ionic2 environment following the instructions given in the Installation section of the official 'Getting Started' Ionic2 documentation.</p>
  
  <p>I am on a Mac with El Captain version 10.11.5 and the latest xCode version (7.3.1) installed.</p>
  
  <p>I have run the command <code>ionic platform add ios</code> successfully after having installed Cordova.</p>
  
  <p>When I run the next command <code>ionic emulate ios</code> (as mentioned in the getting started guide) I get a mysterious error whose log is</p>
  
  <pre><code>(node:38155) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
  
  Running 'emulate:before' gulp task before emulate
  [18:17:00] Starting 'clean'...
  [18:17:00] Finished 'clean' after 45 ms
  [18:17:00] Starting 'build'...
  [18:17:00] Starting 'sass'...
  [18:17:00] Starting 'html'...
  [18:17:00] Starting 'fonts'...
  [18:17:00] Starting 'scripts'...
  [18:17:00] Finished 'html' after 80 ms
  [18:17:00] Finished 'scripts' after 78 ms
  [18:17:00] Finished 'fonts' after 88 ms
  [18:17:01] Finished 'sass' after 901 ms
  [18:17:07] Finished 'build' after 6.73 s
  [18:17:07] Starting 'emulate:before'...
  [18:17:07] Finished 'emulate:before' after 4.22 μs
  
  
  You have been opted out of telemetry. To change this, run: cordova telemetry on.
  
  Running command: /Users/enrico.piccinin/work/dbs/examples/ionic2/cutePuppyPics/hooks/after_prepare/010_add_platform_class.js /Users/enrico.piccinin/work/dbs/examples/ionic2/cutePuppyPics
  
  
  add to body class: platform-ios
  
  Error: 
  
  
  Caught exception:
   undefined 
  </code></pre>
  
  <p>Then I surf a bit and find a suggestion to run the following command <code>npm install -g ios-deploy --unsafe-perm=true</code> but once I do it this is what I obtain</p>
  
  <pre><code>&gt; ios-deploy@1.8.6 preinstall /usr/local/lib/node_modules/.staging/ios-deploy-298c9491
  &gt; ./src/scripts/check_reqs.js &amp;&amp; xcodebuild
  
  /usr/local/lib/node_modules/.staging/ios-deploy-298c9491/src/scripts/check_reqs.js:29
          var ver = arr[1];
                       ^
  
  TypeError: Cannot read property '1' of null
      at ChildProcess.&lt;anonymous&gt; (/usr/local/lib/node_modules/.staging/ios-deploy-298c9491/src/scripts/check_reqs.js:29:16)
      at emitTwo (events.js:106:13)
      at ChildProcess.emit (events.js:191:7)
      at maybeClose (internal/child_process.js:852:16)
      at Socket.&lt;anonymous&gt; (internal/child_process.js:323:11)
      at emitOne (events.js:96:13)
      at Socket.emit (events.js:188:7)
      at Pipe._handle.close [as _onclose] (net.js:492:12)
  npm ERR! Darwin 15.5.0
  npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy" "--unsafe-perm=true"
  npm ERR! node v6.3.0
  npm ERR! npm  v3.10.3
  npm ERR! code ELIFECYCLE
  
  npm ERR! ios-deploy@1.8.6 preinstall: `./src/scripts/check_reqs.js &amp;&amp; xcodebuild`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the ios-deploy@1.8.6 preinstall script './src/scripts/check_reqs.js &amp;&amp; xcodebuild'.
  npm ERR! Make sure you have the latest version of node.js and npm installed.
  npm ERR! If you do, this is most likely a problem with the ios-deploy package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     ./src/scripts/check_reqs.js &amp;&amp; xcodebuild
  </code></pre>
  
  <p>By the way, building for Android works fine on the same machine.</p>
  
  <p>Any idea of what can be wrong?</p>
  
  <p>Thanks a lot in advance for any help</p>