cordova plugman - adding the first platform specific plugin

711 Views Asked by At

my system dependencies:

  • cordova: @7.1.0
  • plugman: @2.0.0

I want to use plugman to install plugins only to specific platform (e.g. android)

I have read the docs and the workflow and usage is not so clear. After creating fresh new cordova project, running successfully the following commands:

cordova create hello-world
cordova platform add android

I wanted to install my first platform specific plugin using this command:

plugman install --platform android --project ./ --plugin cordova-plugin-battery-status

I am getting the following error:

Cannot read property 'fail' of undefined TypeError: Cannot read property 'fail' of undefined
    at C:\Users\liranCo\AppData\Roaming\npm\node_modules\plugman\node_modules\cordova-lib\src\plugman\fetch.js:168:18
    at _fulfilled (C:\Users\liranCo\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\liranCo\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:816:30)
    at Promise.promise.promiseDispatch (C:\Users\liranCo\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:749:13)
    at C:\Users\liranCo\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:509:49
    at flush (C:\Users\liranCo\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:686:11)
    at startup (bootstrap_node.js:187:16)

What is the correct worklow for adding the first platform specific plugin?

1

There are 1 best solutions below

0
On

For some reason this keeps happpening on [email protected].

Install [email protected]

npm remove -g plugman npm install -g [email protected]

then add your plugin specifying full path to

plugman -d install --platform android --project 'platforms/android' --plugin '/Users/blah/my-cordova-plugin'