安装Cordova CLI和Ionic

6

最近我安装了node.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个回答

11
最后答案很简单:将 cordova 更新到特定的包。我最终使用了以下命令:
npm install -g cordova@4

...解决了这个问题。


0

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

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


您的系统信息:

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

0

同样的问题似乎在4.2.0版本中重新出现了。

运行中

$ cordova telemetry off

对我来说解决了这个问题。(cordova遥测似乎也可以工作)

细节:

$ 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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接