Raja Duraisamy
Raja Duraisamy

Reputation: 13

Error message when trying to cordova run android

I am using Cordova 4.3.0 (latest version), I got an error while running this command,

cordova run android

I got an error like this,

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)
    at Object.<anonymous> (/Users/rajad/projects/dkit-cordova/platforms/android/cordova/lib/check_reqs.js:27:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Already I installed 'which' module on my machine,

sudo npm install -g which

Even though, it's throwing module error.

Upvotes: 0

Views: 209

Answers (1)

Keval
Keval

Reputation: 3389

There might be a missing folder - which in: yourapp/platforms/android/cordova/node_modules

So, you can install it after navigating to that location.

cd platforms/android/cordova
sudo npm install which

Let me know if it won't work. There could be a possibility that your Node is broken. In that case you'd have to re-install Node and then add android platform again.

Upvotes: 1

Related Questions