安装Cordova CLI和Ionic

时间:2015-11-19 19:00:46

标签: node.js cordova npm ionic

最近我将ionic.js与ionic和cordova一起安装:

sudo npm install -g cordova ionic

......一切似乎都很好。但是当我跑步时:

ionic info

似乎缺少Cordova CLI:

Your system information:

Cordova CLI: Not installed
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.2 
ios-sim version: 5.0.3 
OS: Mac OS X El Capitan
Node Version: v5.1.0
Xcode version: Xcode 7.1.1 Build version 7B1005 


******************************************************
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。我还试图卸载cordova并重新安装它,在重新安装之前清除npm缓存但运行后

ionic info

......我仍然得到:

Cordova CLI: Not installed

有人知道安装Cordova CLI的正确程序吗?

3 个答案:

答案 0 :(得分:11)

最后答案很简单:将cordova更新为特定包。我最终使用了:

npm install -g cordova@4

...解决了这个问题。

答案 1 :(得分:0)

依赖性警告 - 使CLI正常运行,  强烈建议安装/升级以下内容:

请将您的Cordova CLI安装到版本> = 4.2.0 npm install -g cordova

您的系统信息:

Cordova CLI: Not installed
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.5.0
Xcode version: Not installed

答案 2 :(得分:0)

同样的问题似乎再次出现在4.2.0版本中。

正在运行

$ cordova telemetry off

为我解决了这个问题。 (科尔多瓦遥测似乎也有效)

详细说明:

$ ionic info
******************************************************
 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.5.0

Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.5
Xcode version: Not installed


******************************************************
 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`

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


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


$ ionic info

Your system information:

 ordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.5
Xcode version: Not installed