安装Cordova CLI和Ionic

最近,我将node.js与离子和cordova一起安装在一起:

sudo npm install -g cordova ionic 

…一切似乎工作正常。 但是当我运行:

 ionic info 

看来cordovaCLI是缺less的:

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

然后我试图升级cordovabuild议。 我也尝试卸载cordova并重新安装它,重新安装前,但运行后清除npmcaching

 ionic info 

…我仍然得到:

 Cordova CLI: Not installed 

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

最后答案很简单:将cordova更新为特定的软件包。 我结束了使用:

 npm install -g cordova@4 

解决了这个问题

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

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


您的系统信息:

 Cordova CLI:未安装
离子CLI版本:2.2.1
 Ionic App Lib版本:2.2.0
 ios-deploy版本:未安装
 ios-sim版本:未安装
操作系统:Windows 10
节点版本:v7.5.0
 Xcode版本:未安装

同样的问题似乎再次出现在版本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