How to fix 'cordova' is not recognized in the Windows command prompt
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%\npm\
or if it does not work, use instead
c:\users\YourUserName\AppData\Roaming\npm\
(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.
Try running Command Prompt as an administrator..It worked for me
The Method below is the solution of every such problem related to npm, Be it Phonegap, Cordova, Ionic or else... The concept is that every software installed using npm is saved on this path:
C:\Users\[Your User Name]\AppData\Roaming\npm
So, what we are going to do is just adding the above path to Windows Environment Variable. If you are a begineer, the steps for adding path are as follows:
- Go to Control Panel.
- Under All Control Panel Items, Go to System.
- Click on the Advanced system settings options in the Sidebar.
- The System Properties Dialog Box will appear.
You would have done the so far work through searching "Edit Environment Variables" in Search Bar :).
- Now, In the System Properties dialog box, there will be Advanced Tab.
- In Advanced tab, there will be an option Environment Variables...
- Click on it, this will open another Dialog box for Environment Variables.
In System variables, Select Path as shown in image link, and click Edit...
Path attribute in System Variables
Copy the above path, and add it here as shown in link Copy the Path
- Here, you should make sure that the 2 different paths are always seperated by a semicolon ;. Keeping this in mind, add your path to the existing paths.
This will make the application run globally. This is the General Algorithm of steps employed for any type of Path Configuration. If You have any issues left, please feel free to ask.
npm install -g cordova
-g is a global install option and it will make the cordova globally available in AppData\Roaming\npm. Restart the prompt if necessary.