如何修复 Windows 命令提示符中无法识别的“cordova" [英] How to fix 'cordova' is not recognized in the Windows command prompt

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

问题描述

错误

C:>cordova

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

我的环境路径

C:>path
PATH=C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32
WindowsPowerShellv1.0;C:Program Files
odejs;C:Program Files (x86)Gitcmd
;C:Program Files (x86)GtkSharp2.12in;C:Program Files (x86)Windows Kits8.
1Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server110ToolsB
inn;C:Program FilesMicrosoftWeb Platform Installer;**C:Program FilesANTapa
che-ant-1.9.3in;C:Program FilesJavajdk1.7.0_51in;C:Developmentsdk	ools
;C:Developmentsdkplatform-tools;C:Developmentcordova-3.3.0cordova-android
bin;**

注意:我已经阅读了所有可用的教程,至少遵循了其中的 10 个,阅读了所有关于'phonegap' not识别,,.等的类似问题.正如某些解决方案所建议的那样,我将我的 'Enabled' 注册表设置为 1,重新安装了 'phonegap' &'cordova'NPM install -g phonegap,对于 'cordova' 也是一样,但我仍然无法让它们运行.

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.

我复制了我在另一台 PC 上制作的旧 phonegap 应用程序,我可以很好地运行它.希望这能解决问题.

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%
pm

或者如果它不起作用,请改用

or if it does not work, use instead

c:usersYourUserNameAppDataRoaming
pm

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

(replace YourUserName with the name of your user profile)

奇怪的是我不记得我手动改过,我觉得应该是安装node和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.

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

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