2
votes

so I've been trying to add this plugin with command

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

which worked on MAC and Linux after

npm update -g cordova

but on windows I'm still getting

cannot read property 'install' of undefined

Moreover - when I'm trying to uninstall ( cordova plugin rm org.apache.cordova.inappbrowser ) then I'm getting

cannot read property 'uninstall' of undefined

Weird thing is that I have two cordova folders - one in C:\Users\me\AppData\Roaming\npm\node_modules and the second one in C:\Users\me\AppData\Roaming\npm\node_modules\phonegap\node_modules . Path which I added to my environmental variables is C:\Users\mati\AppData\Roaming\npm\node_modules\phonegap\node_modules\.bin

4

4 Answers

1
votes

I think that this is the problem reported about a week ago as CB-6008 on the Cordova bug tracker.

It may be a symptom of having an out-of-date cordova installation still. The issue there was solved by removing and reinstalling Cordova to ensure that the latest version was in use.

0
votes

Delete the content of your platforms and plugins folder. re-install your plugins and the problem should be gone. In my case the following command

phonegap local plugin add org.apache.cordova.inappbrowser

produced -> [error] Cannot read property 'install' of undefined

and the above procedure fixed it.

0
votes

Have you added a platform to your cordova project (before trying to add a plugin)?

npm update -g cordova cordova create myproject cd myproject cordova platform add android cordova plugin add _

I think the undefined error means a dependency of the add plugin command is not there.

0
votes

For me, the solution was to update plugman module:

npm install -g plugman