Can't find module 'which' - Cordova android
I am trying to build my cordova by running the command
cordova -d build android
but I don't see the error below.
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)
Does anyone know the reason? I have verified that I have my ANT_HOME / ANDROID_HOME in my path, but I'm not sure what is the reason for the error.
I am running Windows 7 64 bit by the way
source to share
As of this question , the solution for me was
$cordova platform remove android
$cordova platform add android
source to share
It happened to me today. I installed which
but then the module was missing chalk
.
Execution npm update
installed all the packages missing and this seems to be the correct way to solve. (But why this happened is mysterious, since it was yesterday node
, and I cannot remember any relevant changes.)
source to share