简体   繁体   中英

Cordova inAppBrowser plugin issue on windows

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

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.

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.

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.

对我来说,解决方案是更新Plugman模块:

npm install -g plugman

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM