Ionic CLI not generating release build for Android


When I use the command: cordova build --release android the CLI throws the following error:

Error: Cannot find module 'minimatch'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\sologic\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\glob\glob.js:44:17)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

But when I use Ionic Lab (Windows Installer) and using the Build option - it generates 'android-debug.apk' & ‘android-debug-unaligned.apk’ in the android\build\outputs\apk folder.

What is wrong with the CLI ??

Also, can I use the android-debug-unaligned.apk for Signing and Aligning for submitting into Google Play ??

Please advice.

Can you paste the output from ionic info

Yes … here it is :

Your system information:

Cordova CLI: 5.3.3
Ionic CLI Version: 1.7.7
Ionic App Lib Version: 0.
OS: Windows 7
Node Version: v4.2.1


Is that all of it? It looks like there’s a few things missing. So this may be from a bad install. Let’s reinstall the cli again.

npm install -g ionic
1 Like

Got the source of all Evil … the system admin guy at my office removed Administrator log in the workgroup PC … at the time of installing the CLI … it threw error every time. I got hold of it when I ran whoami command and it threw error - which should not be the case.

Thanks a lot Mike … thank you very much for your time.