简体   繁体   English

Windows上的Cordova inAppBrowser插件问题

[英]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 科尔多瓦插件添加https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

which worked on MAC and Linux after 之后在MAC和Linux上工作

npm update -g cordova npm更新-g cordova

but on windows I'm still getting 但是在Windows上我仍然

cannot read property 'install' of undefined 无法读取未定义的属性“安装”

Moreover - when I'm trying to uninstall ( cordova plugin rm org.apache.cordova.inappbrowser ) then I'm getting 此外-当我尝试卸载( cordova plugin rm org.apache.cordova.inappbrowser )时,我正在

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 . 奇怪的是,我有两个cordova文件夹-一个位于C:\\Users\\me\\AppData\\Roaming\\npm\\node_modules ,另一个位于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 我添加到我的环境变量的路径是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. 我认为这是大约一个星期前在Cordova错误跟踪器上报告为CB-6008的问题。

It may be a symptom of having an out-of-date cordova installation still. 这可能是仍然安装了过期的cordova的症状。 The issue there was solved by removing and reinstalling Cordova to ensure that the latest version was in use. 通过删除并重新安装Cordova来确保使用了最新版本,从而解决了该问题。

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 phonegap本地插件添加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)? 您是否已在cordova项目中添加了平台(在尝试添加插件之前)?

npm update -g cordova cordova create myproject cd myproject cordova platform add android cordova plugin add _ npm update -g cordova cordova创建myproject cd myproject cordova平台添加android cordova插件添加_

I think the undefined error means a dependency of the add plugin command is not there. 我认为未定义的错误意味着add plugin命令的依赖项不存在。

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

npm install -g plugman

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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