如何修复“cordova”在命令行中无法识别 - windows 8? [英] How to fix 'cordova' is not recognized in command line - windows 8?

查看:603
本文介绍了如何修复“cordova”在命令行中无法识别 - windows 8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误

ERROR

C:\>cordova

'cordova' is not recognized as an internal or external command,
operable program or batch file.

我的环境路径

C:\>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd
;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Windows Kits\8.
1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\B
inn\;C:\Program Files\Microsoft\Web Platform Installer\;**C:\Program Files\ANT\apa
che-ant-1.9.3\bin;C:\Program Files\Java\jdk1.7.0_51\bin;C:\Development\sdk\tools
;C:\Development\sdk\platform-tools;C:\Development\cordova-3.3.0\cordova-android\
bin;**

注意:我已阅读所有可用的教程,其中至少10个,阅读关于 phonegap 无法识别的所有类似问题,等..我已将某些解决方案建议重新安装 'phonegap' ,将 启用 &

NB: I have read every available tutorial, followed at least 10 of them, read all the similar questions about 'phonegap' not recognized,..etc. I have my 'Enabled' registry set to 1 as some solutions have suggested, re-installed 'phonegap' & 'cordova' through npm install -g phonegap, and same for 'cordova', and I still can't get them to run.

UPDATE

我复制了一个我在另一台电脑上制作的旧电话应用程序,我可以通过运行它。

I copied an old phonegap application that I made on another PC, and I can run it through just fine. Hope this would clear anything up.

推荐答案

您不需要将任何cordova文件夹添加到路径中。

You do not need to add any cordova folder to the path.

cordova命令是一个nodejs npm脚本,你需要的是在你的路径中有npm文件夹:

cordova command is a nodejs npm script, what you need is to have the npm folder in your path :

%appdata%\npm\

c:\users\YourUserName\AppData\Roaming\npm\

(将YourUserName替换为您的用户个人资料的名称)

(replace YourUserName with the name of your user profile)

奇怪的是,我不记得我不得不手动更改它,我认为应该在安装节点和npm时自动添加。

What's strange is that I don't remember I had to change it manually, I think it should be added automatically when installing node and npm.

这篇关于如何修复“cordova”在命令行中无法识别 - windows 8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆