简体   繁体   English

Cordova CLI命令甚至没有返回“cordova --version”,安装问题?

[英]Cordova CLI command returns nothing even “cordova --version”, installation issue?

Recently, I needed to try developing a cordova application. 最近,我需要尝试开发cordova应用程序。 I installed android studio with no problem. 我安装android studio没有问题。 Then I went on for Nodejs. 然后我继续使用Nodejs。 I got Nodejs 6.0 installed on my Windows 7 system. 我在Windows 7系统上安装了Nodejs 6.0

It worked fine. 它工作正常。 Then I tried to install cordova with npm command : 然后我尝试使用npm命令安装cordova:

npm install -g cordova

It seemed finally ok. 它似乎终于好了。 The verbose message appeared and the graphical text displayed the folder structure of the installed components, which I thought, this tells me the success install. 出现了详细消息,图形文本显示了已安装组件的文件夹结构,我认为,这告诉我安装成功。

When I typed node --version , it showed 6.0.0 , the nodejs has been installed correctly. 当我键入node --version ,它显示6.0.0 ,nodejs已正确安装。

Then I typed npm --version , it showed 3.8.8 . 然后我输入了npm --version ,它显示了3.8.8 So npm works ok. 所以npm工作正常。

After that, I typed cordova --version to validate the installation, it seemed to fetch something for a little while and return the prompt without printing anything or even its version. 在那之后,我键入了cordova --version来验证安装,它似乎在一段时间内获取了一些内容并返回提示而不打印任何内容甚至是它的版本。

I took another try, I typed cordova help . 我再次尝试,我输入了cordova help Same thing, there's nothing happen. 同样的事情,没有任何事情发生。 It just failed or got error somehow silently. 它只是失败或以某种方式默默地得到错误。

I removed cordova with npm uninstall -g cordova , and tried install again to eventually get the same result. 我用npm uninstall -g cordova删除了npm uninstall -g cordova ,并再次尝试安装以最终获得相同的结果。 I even tried to remove nodejs and re-install all over again but no luck. 我甚至试图删除nodejs并重新安装,但没有运气。

Is there anyone out there faced the same to me? 那里有人和我面对面吗? And how did you solve this problem? 你是怎么解决这个问题的? Any idea? 任何想法?

  1. Make sure this is in your System Path (under : PC -> Properties -> Advanced System Settings -> Environment Variables ) 确保这在您的系统路径中(在: PC -> Properties -> Advanced System Settings -> Environment Variables

    C:\\Users\\ Your User \\AppData\\Roaming\\npm C:\\ Users \\ Your User \\ AppData \\ Roaming \\ npm

  2. Try to close and re-open your command prompt ;) 尝试关闭并重新打开命令提示符;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM