Search code examples
androidnode.jscordovacmderror-code

cmd: Command failed with exit code ENOENT


I'm trying to use phonegap to make an android app, but it shows me this:

    c:\Users\sshewale\Desktop\phone gap\hello>phonegap platform add android
    npm
     http GET https://registry.npmjs.org/cordova-android
    
    npm http 304 https://registry.npmjs.org/cordova-android
    
    Adding android project...
    
    Error: cmd: Command failed with exit code ENOENT
        at ChildProcess.whenDone (C:\Users\sshewale\AppData\Roaming\npm\node_modules
    \phonegap\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.j
    s:134:23)
        at ChildProcess.emit (events.js:107:17)
        at Process.ChildProcess._handle.onexit (child_process.js:1072:12)
        at child_process.js:1144:20
        at process._tickCallback (node.js:355:11)

UPDATE: It Moved A Bit Ahead But Now It Shows This:

        C:\Users\sshewale\hi>cordova platform add android
    npm http GET https://registry.npmjs.org/cordova-android
    npm http 200 https://registry.npmjs.org/cordova-android
    npm http GET https://registry.npmjs.org/cordova-android
    npm http 200 https://registry.npmjs.org/cordova-android
    npm http GET https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.2.
    tgz
    npm http 200 https://registry.npmjs.org/cordova-android/-/cordova-android-4.0.2.
    tgz
    Adding android project...
    Error: cmd: Command failed with exit code ENOENT
        at ChildProcess.whenDone (C:\Users\sshewale\AppData\Roaming\npm\node_modules
    \cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
        at ChildProcess.emit (events.js:107:17)
        at Process.ChildProcess._handle.onexit (child_process.js:1072:12)
        at child_process.js:1144:20
        at process._tickCallback (node.js:355:11)
    
    C:\Users\sshewale\hi>

I'm not sure why this is happening, I don't remember changing any setting from the defaults.


Solution

  • Please add C:\Windows\System32 in your PATH variable