Cordova Error: command failed with exit code ENOENT browser or Android


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

Variable

PATH

Value

C:\Windows\System32

Once added close your cmd and run it again.

That should be fine!

Road to cordova – Windows 7 Installation


Follow these steps to install Cordova:

  1. 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
  2. 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.
  3. 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:
  1. node --version
  1. 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.
  2. Install Cordova. Cordova is installed using the Node Package Manager (npm). Type the following in the command window to install:
    npm install -g cordova
  3. Test the Cordova install by typing:
    cordova --version

    If you see the version number, you have successfully installed Apache Cordova!

Continue reading Road to cordova – Windows 7 Installation