Search code examples
cordovaphonegap-pluginscordova-plugins

Installing of email composer cordova plugin error


Error when run in command promopt

When I run cordova plugin add [email protected] in my command prompt, I get this error and the plugin is installed into my phonegap plugins folder.

Failed to install 'cordova-plugin-email-composer':Error: cmd: Command failed with exit code ENOENT at ChildProcess.whenDone (C:\Users\User\AppData\Roaming\npm\node_modules\c ordova\node_modules\cordova-common\src\superspawn.js:169:23) at emitOne (events.js:96:13) at ChildProcess.emit (events.js:188:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:202:12) at onErrorNT (internal/child_process.js:348:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) at Module.runMain (module.js:577:11) at run (node.js:348:7) at startup (node.js:140:9) Error: cmd: Command failed with exit code ENOENT

How do I solve this error and what is causing this error?


Solution

  • If you search the error of Command failed with exit code ENOENT then generally it is because of a old version of either plugin or cordova itself

    I am using version 6.2.0 ( c:>cordova -v ) of cordova

    This plugin is installed successfully into my app

    So what actually you have to do is to update your cordova, below is a process of upgrading your cordova

    In a Windows environment:

    If you have already installed cordova, then follow the steps:

    1) npm uninstall -g cordova
    2) Delete folder C:\Users\your-name.cordova
    3) Into Environment Variables...
    4) Define C:\Windows\System32 as a System Variable(Bottom Window) ie SYSTEM_HOME
    5) Then define %SYSTEM_HOME% in the Server Variables (Top Window)
    6) Then run npm install -g cordova
    7) Now go to the project folder and try again: cordova platform add android

    Hope this will help you