Ionic-framework: Cannot use ionic cordova run android after updating to Ionic 3.7.0

Created on 3 Aug 2017  Â·  31Comments  Â·  Source: ionic-team/ionic-framework

Error occurred during command execution from a CLI plugin
(@ionic/cli-plugin-cordova). Your plugins may be out of date.
TypeError: env.runcmd is not a function

felixs-MacBook-Pro:tapping backup$ [00:16:10] tslint: src/pages/home/home.ts, line: 5
Unused import: 'Geoposition'

   L4:  import { MainPage } from '../main/main';
   L5:  import { Geolocation, Geoposition } from '@ionic-native/geolocation';
   L6:  import { NativeGeocoder, NativeGeocoderReverseResult } from '@ionic-native/native-geocoder';

[00:16:10] tslint: src/pages/home/home.ts, line: 6
Unused import: 'NativeGeocoderReverseResult'

   L5:  import { Geolocation, Geoposition } from '@ionic-native/geolocation';
   L6:  import { NativeGeocoder, NativeGeocoderReverseResult } from '@ionic-native/native-geocoder';
   L7:  import { LocationAccuracy } from '@ionic-native/location-accuracy';

[00:16:10] tslint: src/app/app.module.ts, line: 16
Unused import: 'LoadingController'

  L15:  import { MannersPage } from '../pages/manners/manners';
  L16:  import { LoadingController } from 'ionic-angular';
  L17:  import { DrinkDatabaseProvider } from '../providers/drink-database/drink-database';

(node:8878) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed

Most helpful comment

That was related to the version of @ionic/cli-plugin-cordova for me. I downgraded to version 1.4.1 (that was the version I added last week):

npm uninstall --save-dev @ionic/cli-plugin-cordova
npm install --save-dev @ionic/[email protected]

Is any of you using a more up-to-date version that still works ?

All 31 comments

Hi! I Have something similar to this an issue, after running ionic cordova build for IOS.
The log:

[08:18:07]  build dev started ... 
[08:18:07]  clean started ... 
[08:18:07]  clean finished in 5 ms 
[08:18:07]  copy started ... 
[08:18:07]  transpile started ... 
[08:18:10]  transpile finished in 2.52 s 
[08:18:10]  preprocess started ... 
[08:18:10]  deeplinks started ... 
[08:18:10]  deeplinks finished in 77 ms 
[08:18:10]  preprocess finished in 78 ms 
[08:18:10]  webpack started ... 
[08:18:10]  copy finished in 2.99 s 
[08:18:19]  webpack finished in 8.50 s 
[08:18:19]  sass started ... 
[08:18:19]  sass finished in 968 ms 
[08:18:19]  postprocess started ... 
[08:18:19]  postprocess finished in 5 ms 
[08:18:19]  lint started ... 
[08:18:20]  build dev finished in 12.14 s 
[WARN] Error occurred during command execution from a CLI plugin
       (@ionic/cli-plugin-cordova). Your plugins may be out of date.
TypeError: env.runcmd is not a function
Romans-MBP-2:app roman$ (node:1732) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed
Romans-MBP-2:app roman$ 

I got the same error too. Please help
ionic cordova build ios --prod

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
date.
TypeError: env.runcmd is not a function
some unused imports warnings.
(node:6516) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed

my cli is CLI 3.5.0
my package.json file looks like this.

  "dependencies": {
    "@angular/common": "2.4.8",
    "@angular/compiler": "2.4.8",
    "@angular/compiler-cli": "2.4.8",
    "@angular/core": "2.4.8",
    "@angular/forms": "2.4.8",
    "@angular/http": "2.4.8",
    "@angular/platform-browser": "2.4.8",
    "@angular/platform-browser-dynamic": "2.4.8",
    "@angular/platform-server": "2.4.8",
    "@ionic-native/camera": "^3.14.0",
    "@ionic-native/core": "^3.6.0",
    "@ionic/cloud-angular": "^0.11.0",
    "@ionic/storage": "2.0.0",
    "angularfire2": "^2.0.0-beta.7-pre",
    "cordova-ios": "^4.4.0",
    "cordova-plugin-camera": "^2.4.1",
    "cordova-plugin-compat": "^1.1.0",
    "cordova-plugin-console": "^1.0.7",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-whitelist": "^1.3.2",
    "firebase": "^3.9.0",
    "ionic-angular": "2.2.0",
    "ionic-native": "^2.9.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionic2-rating": "^1.2.2",
    "ionicons": "3.0.0",
    "phonegap-plugin-push": "^1.10.5",
    "rxjs": "5.0.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.7.2",
    "cordova-android": "^6.2.3"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.1.4",
    "@ionic/cli-plugin-cordova": "1.6.1",
    "@ionic/cli-plugin-ionic-angular": "1.3.2",
    "ionic-gulp-browserify-typescript": "^2.0.0",
    "typescript": "2.0.9"
  },
  "cordovaPlugins": [
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-splashscreen",
    "cordova-plugin-device",
    "cordova-plugin-whitelist",
    "ionic-plugin-keyboard"
  ],

Hey guys, I'm having the same problem and I have to present my app in few hours! This is my final project to graduate! I'm desperate, really.. I have no ideia how to fix it.. Does someone solved this problem?

Bruno my best guess is that their update is bugged, but emulating it
through your browser should still work.

On Thu, Aug 3, 2017 at 2:03 AM, brunosaales notifications@github.com
wrote:

Hey guys, I'm having the same problem and I have to present my app in few
hours! This is my final project to graduate! I'm desperate, really.. I have
no ideia how to fix it.. Does someone solved this problem?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic/issues/12561#issuecomment-319876243,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK-f44HiVmp2CRCbuxo6zhp5UddRbPzlks5sUWLEgaJpZM4Or8Ba
.

to be more specific ionic serve should still work

On Thu, Aug 3, 2017 at 2:08 AM, Raymond Lian lian@mail.usf.edu wrote:

Bruno my best guess is that their update is bugged, but emulating it
through your browser should still work.

On Thu, Aug 3, 2017 at 2:03 AM, brunosaales notifications@github.com
wrote:

Hey guys, I'm having the same problem and I have to present my app in few
hours! This is my final project to graduate! I'm desperate, really.. I have
no ideia how to fix it.. Does someone solved this problem?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic/issues/12561#issuecomment-319876243,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK-f44HiVmp2CRCbuxo6zhp5UddRbPzlks5sUWLEgaJpZM4Or8Ba
.

@fl0r1d4 , actually ionic serve is working fine.
But the problem is because I'm using facebook and google plus api to login, and I can't do it by web browser, it works only using the smartphone. Do you know if I downgrade to the previous ionic version should work? If yes, how can I do it?

Hi all. I got the same error
And I think I found a temporary solution:

  1. Remove node_modules folder
  2. Revert @ionic/cli-plugin-cordova and @ionic/cli-plugin-ionic-angular version changes in package.json file
  3. run npm install
  4. run build command

After that, I've got successful build

@MichaelBrovchenko I think you can simply use npm install --save --save-exact [email protected] to downgrade

Bruno I got it to work by downgrading to version 3.6.0 and then updating it
again to the latest version. I hope everything works out for you

On Aug 3, 2017 2:13 AM, "brunosaales" notifications@github.com wrote:

@fl0r1d4 https://github.com/fl0r1d4 , actually ionic serve is working
fine.
But the problem is because I'm using facebook and google plus api to
login, and I can't do it by web browser, it works only using the
smartphone. Do you know if I downgrade to the previous ionic version should
work? If yes, how can I do it?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic/issues/12561#issuecomment-319877713,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK-f49Ko7gBb_Bl60hoh_CZFQXyVu9tmks5sUWUlgaJpZM4Or8Ba
.

i remove cordova and ionic then reinstall both of them.When i run the project did not accept to automatic updates. I can run ionic cordova build ios command

Hi, I had the same problem with Ionic CLI 3.6.0. After change dependency to 3.7.0 and update it, build now works. Maybe a dependency problem...

Hi, I had a similar issue with a build for an ios app. I ran "cordova platform add ios" and "cordova platform add android" and now it seems to be working. Might be worth trying with your issue.

Hi there, can someone post the output from ionic info?

global packages:

    @ionic/cli-utils : 1.5.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.5.0

local packages:

    @ionic/app-scripts : 1.3.7
    Cordova Platforms  : ios 4.4.0
    Ionic Framework    : ionic-angular 3.3.0

System:

    Node       : v8.1.4
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002 
    ios-deploy : 1.9.1 
    ios-sim    : not installed
    npm        : 5.3.0 

That was related to the version of @ionic/cli-plugin-cordova for me. I downgraded to version 1.4.1 (that was the version I added last week):

npm uninstall --save-dev @ionic/cli-plugin-cordova
npm install --save-dev @ionic/[email protected]

Is any of you using a more up-to-date version that still works ?

@royalcheeseburger thank you, that issue was the nightmare.

So Im trying to test this out and attempt to recreate the issue, but I am unable to.
Im using 1.6.1. of the cli-cordova plugin, but still not able to recreate.
Does anyone have any steps I could follow in order to recreate this?

@mhartington I am not sure that this will help you but this morning (Paris time) I run a ionic cordova emulate ios command and been asked to update Ionic CLI. I said yes and right after that compilation failed.
Unfortunately I didn't pay attention to the version...
I am not really familiar with the auto-update thing but I am not prompted to update the CLI anymore though I am using an older version. How can I do to be asked again and try to reproduce the issue for you?

I got this error after updating to cli-plugin-cordova from 1.5.0 -> 1.6.1 and cli-plugin-ionic-angular from 1.4.0 -> 1.5.1
Fixed it by just downgrading both back to 1.5.0 and 1.4.0 respectively

Hmm, alright. We're still not able to replicate this, tested on both osx and windows. We'll leave this open and keep and eye out it for now.

I was able to revert to a prior version with:

npm install --save --save-exact @ionic/[email protected]

That solved my problem

Hi all, TypeError: env.runcmd is not a function is a direct result of version incompatibilities between functions in the Ionic CLI and functions in the CLI plugins. Unfortunately there's not a very good solution to this yet (I am hoping to get rid of the plugins but keep the CLI feature complete and lightweight). There may be other weird JS runtime errors.

My advice is first make sure your global (and local, if installed) CLI is up to date (npm i -g ionic@latest). Then, always turn on the background update checker (ionic config set -g daemon.updates true) and always respond Y to update prompts. It will ensure the versions match between the CLI and CLI plugins.

@dwieeb really thanks for very good and working answer

as @dwieeb says always respond Y to update prompts
I just updated globally > npm i -g ionic@latest
now it's working thanks @dwieeb

Thanks for your support @fl0r1d4 ! I could present my app and now I'm graduated! hahaha
I downgraded and worked fine to me. But before, I deleted package lock file and then updated!

Its excellent news to hear things are moving foward for you @brunosaales. I
wish you the best!

On Sun, Aug 6, 2017 at 2:19 PM, brunosaales notifications@github.com
wrote:

Thanks for your support @fl0r1d4 https://github.com/fl0r1d4 ! I could
present my app and now I'm graduated! hahaha
I downgraded and worked fine to me. But before, I deleted package lock
file and then updated!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ionic-team/ionic/issues/12561#issuecomment-320523261,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AK-f465IQKDzz1ld9lNtHb6RcwATqmJXks5sVgPAgaJpZM4Or8Ba
.

Oh man, I really appreciate it! I wish you the same, @fl0r1d4 ! Greetings from Brazil!

Thanks, @dwieeb, that did the trick. I'm using @ionic/cli-plugin-cordova 1.6.2 (latest) and was receiving the error. After I updated the global an local ionic CLI to the latest (3.7.0) it worked (my local ionic was 3.6.0).

For those following this topic, I _just_ published a new 3.8 version of the CLI which removes these pesky, complex plugins. All functionality has been merged back in and all you need to do is update!

See more details in the CLI changelog: https://github.com/ionic-team/ionic-cli/blob/master/CHANGELOG.md#380-2017-08-14

This did it. Thanx

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings