Failed to get absolute path to installed module

When I try to run the following comand

cordova plugin add cordova-plugin-ionic --save \ --variable APP_ID="####" \ --variable CHANNEL_NAME="Production" \ --variable UPDATE_METHOD="background"

and I got the followin insues

Adding cordova-plugin-ionic to package.json
Saved plugin info for "cordova-plugin-ionic" to config.xml
(node:12684) UnhandledPromiseRejectionWarning: CordovaError: Failed to get absolute path to installed module
    at C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:112:45
    at _rejected (C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:864:24)
    at C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:41)
    at C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:624:44
    at runSingle (C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:137:13)
    at flush (C:\Users\Julia\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:12684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My infos

cli packages: (C:\Users\Julia\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 26.1.1
    Node              : v8.11.3
    npm               : 6.2.0-next.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\Julia\AppData\Local\Android\Sdk

Misc:

    backend : pro

Whay this is happen?

1 Like

I have the exact same problem. Tried to reinstall cordova globally but without success.

I resolved this removing this ‘’ on windows and works fine

cordova plugin add cordova-plugin-ionic --save  --variable APP_ID="####"  --variable CHANNEL_NAME="Production"  --variable UPDATE_METHOD="background"

1 Like

I couldnt understand what to remove in @juliateixeira but after looking at both command i realise that she omited the back slashes \

This

cordova plugin add cordova-plugin-ionic --save  --variable APP_ID="####"  --variable CHANNEL_NAME="Production"  --variable UPDATE_METHOD="background"

Instaed of

cordova plugin add cordova-plugin-ionic --save \ --variable APP_ID="####" \ --variable CHANNEL_NAME="Production" \ --variable UPDATE_METHOD="background"

And that worked on windows, Thanks @juliateixeira

1 Like

Thanks OutsourceNow and @juliateixeira - worked for me. Can someone correct the documentation so others do not get the same issue.