Windows命令提示符下无法识别如何修复"cordova" [英] How to fix 'cordova' is not recognized in the Windows command prompt
问题描述
错误
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' not recognized,
、. etc的所有类似问题.根据某些解决方案的建议,我已将我的 '已启用' 注册表设置为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%\npm\
或者,如果不起作用,请改用
or if it does not work, use instead
c:\users\YourUserName\AppData\Roaming\npm\
(用您的用户个人资料名称替换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屋!