Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'which' - Cordova android

I am trying to build my cordova build by executing below command

cordova -d build android

but I am necountering below error.

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) 

anyone knows the reason? I checked that I have my ANT_HOME/ANDROID_HOME in my path but I am not sure what is the reason behind the error though.

I am running windows 7 64 bit by the way

like image 849
Mark Estrada Avatar asked Dec 10 '25 07:12

Mark Estrada


1 Answers

Similar to the answer to this question, the solution for me was to

$cordova platform remove android
$cordova platform add android
like image 179
Adam Avatar answered Dec 11 '25 22:12

Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!