cordova platfrom add android not working on Windows7. Its giving following error.
C:\\Users\\user\\cordova_projects\\myapp>cordova platforms add android
npm http GET https://registry.npmjs.org/cordova-android/3.6.4
npm http 304 https://registry.npmjs.org/cordova-android/3.6.4
Creating android project...
Error: C:\\Users\\user.cordova\\lib\\npm_cache\\cordova-android\\3.6.4\\package\\bin\\cr
eate.bat: Command failed with exit code -1073741819
at ChildProcess.whenDone (C:\Users\user\AppData\Roaming\npm\node_modules\cor
dova\\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)
This looks a path setting issue, I am too working on Window 7 and had similar issues initially when i had wrong path set. Plus there are no# of questions on SO where due to path have similar issues reported ...see this & this and this .
Here is how I set paths, so you check and set yours accordingly, hope will help you.
ANT_Home : C:\\Program Files\\apache-ant-1.9.4
Java_Home : C:\\Program Files\\Java\\jdk1.7.0_60
ANDROID_HOME : C:\\Android\\AndroidSDK\\sdk
and path variable references to three things:
path :.;C:\\Program Files\\nodejs\\;%ANT_HOME%\\bin;%ANDROID_HOME%\\platform-tools;%ANDROID_HOME%\\tools;
您应该尝试清除缓存:
npm cache clean
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.