Platform add android, exit code ENOENT 1

$ gulp --cordova "platform add android"
[16:28:00] Using gulpfile ~\ioProjects\Hematology\gulpfile.js
[16:28:00] Starting 'default'...
cordova
[16:28:00] Starting 'cordova'...
[16:28:00] Finished 'default' after 42 ms
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.everywhereim.Hematology
        Name: Hematology
        Activity: MainActivity
        Android target: android-23
Android project created with cordova-android@5.1.1
Running command: "C:\Program Files\nodejs\node.exe" "C:\Users\David Demmers\ioProjects\Hematology\hooks\after_prepare\update_platform_config.js" "C:/Users/David Demmers/ioProjects/Hematology"
Installing "cordova-plugin-device" for android
Failed to install 'cordova-plugin-device':Error: cmd: Command failed with exit code ENOENT
    at ChildProcess.whenDone (C:\Users\David Demmers\ioProjects\Hematology\node_modules\cordova-lib\node_modules\cordova-common\src\superspawn.js:139:23)
    at emitOne (events.js:96:13)
    at ChildProcess.emit (events.js:188:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
    at onErrorNT (internal/child_process.js:367:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
Error: cmd: Command failed with exit code ENOENT
[16:28:07] 'cordova' errored after 6.31 s
[16:28:07] Error in plugin 'gulp-shell'
Message:
    Command `node_modules\cordova\bin\cordova platform add android` failed with exit code 1

Tried to execute platform add android, for it only to fail while trying to install the first plugin. this is not a version problem as a colleague of mine had no problems and we have the same versions installed

removing cordova , node and ionic in several ways doesnt solve it.

tried several times to start the root folder from scratch and clone from git again.

nothing seems to work,

if there is anyone who knows what i am missing/ doing wrong id love to hear

  • David

Mac

npm uninstall cordova ionic
npm cache clean -f
sudo npm install -g cordova@6.5.0

Window

npm uninstall cordova ionic
npm cache clean -f
npm install -g cordova@6.5.0

No. Bad. Use nvm instead.

Well i tried re instelling cordova and also set it to 6.5.0 I also set it to static in the config and (even going as far as removing the hidden folder in the users directory ) but I guesse a clean cache couldn’t hurt,.
I’ll try it right now in the train on my way to work

Thanks very much for the help in any case

Thanks a bunch, didnt figure just the cache clear would do the trick, o well it worked !

1 Like