cordova - Ionic cannot add android platform -
i trying add android platform using following command
ionic platform add android
i presented following output:
creating android project... module.js:340 throw err; ^ error: cannot find module 'which' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object.<anonymous> (/users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:27:13) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) error: /users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/create: command failed exit code 8 @ childprocess.whendone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) @ childprocess.emit (events.js:98:17) @ maybeclose (child_process.js:756:16) @ process.childprocess._handle.onexit (child_process.js:823:5)
i have set path in bash_rc file such:
export path=/users/user1/android-sdk-macosx/platform-tools:/users/user1/android-sdk-macosx/tools:$path
adding ios platform simple; no problems there.
i checked android sdk , seems date. tried reinstalling cordova sudo npm -g uinstall cordova
followed sudo npm -g install cordova
i have checked npm
, cordova
, , ionic
have been installed globally.
check in directory
/users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/
there should 3 modules in directory, which
, shelljs
, q
. part of cordova-android 3.6.4 release hard see why 1 missing. if which
not there might best remove android platform , add again.
ionic platform rm android
update after comment.
i don't think reinstalling android platform make difference. looks more node issue specific environment. check_reqs script failing run
/users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib
directory. if change directory run node interactively can run run command:
require('which')
if fails run:
module.paths
which print out paths node used attempt find module. there should entry for
/users/user1/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules
which which
module is.
Comments
Post a Comment