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

+3


source to share


4 answers


As of this question , the solution for me was



$cordova platform remove android
$cordova platform add android

      

+7


source


This looks like some kind of missing node module for me .. Have you tried:



npm install -g which

      

0


source


Your nodejs installation seems to be broken. This happens when install / update from yum (for example) failed. For my case, I just removed the broken modules from "/ usr / lib / node_modules" and did the installation.

0


source


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.)

0


source







All Articles