Ionic error of Cordova lower version - Please install your Cordova CLI to version >=4.2.0

I am using [email protected] and [email protected] as well. After I got this error message, I opened a new terminal and typed cordova -v which outputted:

? May Cordova anonymously report usage statistics to improve the tool over time?

As soon as I entered my answer (No), the version number printed out and then I re-ran ionic info in my project terminal. The error was gone.

Caveats

  • I had just updated [email protected] from 1.7.15. It's a very minor patch with one set of bug fixes that are not related to this.
  • The particular system that I had this problem with is running Windows 10.
  • The first time I ran ionic info in my project directory, I got the same error twice.

Original Error Output:

******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

Your system information:

You have been opted out of telemetry. To change this, run: cordova telemetry on.
6.2.0

Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
OS:
Node Version: v4.4.2


******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

I've tried a lot of different methods to resolve this, like reinstall with and without the --unsafe-perm=true --allow-root flags (which is how others advised to fix it on other questions/other places online) but it seems to be an issue with cordova at version 6.1.0 and ionic so for now use 6.0.0 by running

npm install -g [email protected]

That should do the trick as it is seems 6.1.0 isn't a stable version.


cordova telemetry off

Made the error disappear when running

ionic info

I chose to opt out of Telemetry which collects data during development for analytics. You can also opt in by using the "on" keyword instead.

Hat tip to Wayne Bloss for guiding me to this answer.