IONIC CLI Could Not Add Android Platform

I tried to add the 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 him?

+4
source share
1 answer

I think your cordova npm package has been missed by some modules. Try reinstalling it:

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

I am using version 5.0 and it works fine, if the above does not work, try the following:

npm uninstall cordova -g && npm install -g cordova@5.0
+3
source

Source: https://habr.com/ru/post/1613437/


All Articles