title: phonegap build error - you may not have the required environment
body: <p>When ever I'm trying to build my phonegap project with: 
      <code>$phonegap</code> build</p>
  
  <p>an error is encountered failing the compilation. Kindly find the error message and testify for its origin and solution.</p>
  
  <pre><code>E:\phonegap projects\myproject&gt;cordova build android
  Running command: cmd "/s /c ""E:\phonegap projects\myproject\platforms\android\cordova\build.bat"""
  ANDROID_HOME=C:\Users\rajan\AppData\Local\Android\sdk
  JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45
  cp: copyFileSync: could not write to dest file (code=EPERM):E:\phonegap projects\myproject\platforms\android\gradlew.bat
  
  shell.js: internal error
  Error: EPERM, operation not permitted 'E:\phonegap projects\myproject\platforms\android\gradle\wrapper\gradle-wrapper.properties' at Error (native) at Object.fs.openSync (fs.js:500:18) at Object.fs.writeFileSync (fs.js:1099:15) at Object._sed (E:\phonegap projects\myproject\platforms\android\cordova\node_modules\shelljs\src\sed.js:39:8) at Object.sed (E:\phonegap projects\myproject\platforms\android\cordova\node_modules\shelljs\src\common.js:172:23) at E:\phonegap projects\myproject\platforms\android\cordova\lib\build.js:322:23 at _fulfilled (E:\phonegap projects\myproject\platforms\android\cordova\node_modules\q\q.js:798:54) at self.promiseDispatch.done (E:\phonegap projects\myproject\platforms\android\cordova\node_modules\q\q.js:827:30) at Promise.promise.promiseDispatch (E:\phonegap projects\myproject\platforms\android\cordova\node_modules\q\q.js:760:13) at E:\phonegap projects\myproject\platforms\android\cordova\node_modules\q\q.js:574:44
  ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
  You may not have the required environment or OS to build this project
  Error: cmd: Command failed with exit code 1 at ChildProcess.whenDone (C:\Users\rajan\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
  </code></pre>