Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

android - How to fix 'cordova' is not recognized in the Windows command prompt

ERROR

C:>cordova

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

My Environment Path

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:Developmentsdkools
;C:Developmentsdkplatform-tools;C:Developmentcordova-3.3.0cordova-android
bin;**

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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

(replace YourUserName with the name of your user profile)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...