Arup Bhattacharya
Arup Bhattacharya

Reputation: 856

IONIC CLI could not add Platform Android

I tried to add Android platform with 'ionic platform add android' and it gave the following error:

> C:\Users\---\Desktop\Tst\Test>ionic platform add android
>     Updated the hooks directory to have execute permissions
>     Downloading Default Ionic Resources
>     Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.zip
>     [=============================]  100%  0.0s
>     Done adding default Ionic resources
>     Adding icons for platform: android
>     Error: Cannot find module 'config-chain'
>         at Function.Module._resolveFilename (module.js:337:15)
>         at Function.Module._load (module.js:287:25)
>         at Module.require (module.js:366:17)
>         at require (module.js:385:17)
>         at Object.<anonymous> (C:\Users\---\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npmconf\npmconf.js:2:10)
>         at Module._compile (module.js:435:26)
>         at Object.Module._extensions..js (module.js:442:10)
>         at Module.load (module.js:356:32)
>         at Function.Module._load (module.js:311:12)
>         at Module.require (module.js:366:17)
>         at require (module.js:385:17)
>     
>     C:\Users\---\Desktop\Tst\Test>

What is wrong with it ?

Upvotes: 4

Views: 1283

Answers (1)

Nam Pham
Nam Pham

Reputation: 1224

I think your cordova npm package has been missed some modules. Try this to re-install it:

npm uninstall cordova -g && npm install -g cordova

I'm using version 5.0 and it works fine, if above not works, try this:

npm uninstall cordova -g && npm install -g [email protected]

Upvotes: 3

Related Questions