Reputation: 99
I am using Ionic 3. Right now I'm trying to do ionic cordova build android
, but I get TypeError: env.runcmd is not a function (please see the photo attached).
I tried to:
-> ionic cordova platform rm android
then ionic cordova platform add android
then again build android again
-> delete node_modules
folder and do npm install
then build android again
But none of them helped it...
Upvotes: 0
Views: 1615
Reputation: 99
Okay, guys, the problem was exactly with cordova version. I haven't noticed when it did update to the version 7.0.1
. However, I had to downgrade it to version 6.5.0
and then android build succeeded.
The only thing that confused me was the downgrade process. Every time I did sudo npm uninstall cordova -g
, the cordova
command was still available at bash. If I would do sudo npm install [email protected] -g
, the version still remained 7.0.1
. Even some other commands such as ... --save --save-exact ...
did NOT work.
So below are the steps which I've gone through to solve this issue (I am using Ubuntu linux, so this will work for linux users only).
First I uninstalled cordova through npm
sudo npm uninstall cordova -g
Then removed the program from local bin
sudo rm /usr/local/bin/cordova
Installed the specific version of cordova
sudo npm install [email protected] -g
(or whatever version you want)
And lastly, I have to admit that after cordova installation, it was now located at /usr/bin/cordova
, no more at /usr/local/bin/cordova
, so I had to create a hard link to it.
sudo ln -s /usr/local/bin/cordova /usr/bin/cordova
Voilà!
Upvotes: 0
Reputation: 11
Just use command 'cordova run android' instead of 'ionic cordova run android'.
Upvotes: 1