Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Installed Ionic successfully. When running ionic info and other commands like ionic browser --list, I get an error that cordova is lower then version 4.

Cordova is installed with no sudo and in global home directory.

> ionic info  Your system information:  Cordova CLI: 6.1.0 (cordova-lib@undefined) Gulp version:  CLI version 3.9.1 Gulp local:   Local version 3.9.1 Ionic Version: 1.2.4 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0 OS: Distributor ID:     Ubuntu Description:     Ubuntu 15.10  Node Version: v5.9.1   ******************************************************  Dependency warning - for the CLI to run correctly,        it is highly suggested to install/upgrade the following:        Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`  ****************************************************** 

Cordova installation is at:

> which cordova   /home/user_1/.npm-global/bin/cordova 

Ionic installation is at:

> which ionic /home/user_1/.npm-global/bin/ionic 
like image 593
elpddev Avatar asked Mar 29 '16 12:03

elpddev


2 Answers

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`  ****************************************************** 
like image 149
Wayne Bloss Avatar answered Sep 18 '22 20:09

Wayne Bloss


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.

like image 44
garrettmac Avatar answered Sep 22 '22 20:09

garrettmac