If you are using Windows 7 etc.
When adding a platform for example browser, I’ve got this error
$ cordova platform add browser
Adding browser project...
Running command: cmd "/s /c "C:\Users\UserName\.cordova\lib\npm_cache\cordova-browser\4.1.0\package\bin\create.bat D:\localhost\cordova\testing\platforms\browser io.cordova.hellocordova HelloCordova""
Error: cmd: Command failed with exit code ENOENT
The error occur when the C:\Windows\System32 is missing in the environment variable.
So in my case for some reason the C:\Windows\System32 is removed, so I need to put it back in the environment variable
Once added close your cmd and run it again.
That should be fine!
Follow these steps to install Cordova:
- Install Node.js. Cordova runs on the Node.js platform, which needs to be installed as the first step. Download installer from: http://nodejs.org
- Go ahead an run the downloaded installation file. It is recommended to use the default settings. Node.js needs to be added to the PATH environment variable, which is done by default.
- To test the installation, open a command window (make sure you open a new command window to get the updated path settings made by the Node.js installation), and type:
- Install Git. Git is a version control system, which is used by Cordova behind-the-scenes. Download and install from: http://git-scm.com. Default settings are recommended.
- Install Cordova. Cordova is installed using the Node Package Manager (npm). Type the following in the command window to install:
npm install -g cordova
- Test the Cordova install by typing:
If you see the version number, you have successfully installed Apache Cordova!
Continue reading Road to cordova – Windows 7 Installation