简体   繁体   English

依赖插件版本错误 - 将 phonegap-push 插件安装到已经安装了 firebase-analytics 插件的现有 Ionic 应用程序时

[英]Dependency plugin version error - When installing phonegap-push plugin to an existing Ionic app that has firebase-analytics plugin already installed

I was facing dependency errors so created a new project to test this.我遇到了依赖错误,所以创建了一个新项目来测试这个。 See steps to replicate issue below.请参阅下面复制问题的步骤。

Environment:环境:

  • Node: v10.14.1节点:v10.14.1
  • Ionic: v4.6.0离子:v4.6.0
  • npm: 6.4.1 npm:6.4.1
  • Angular CLI: 7.1.2角 CLI:7.1.2
  • Angular: 5.2.11角度:5.2.11

Steps:脚步:

  1. Run -> ionic start TestP运行 -> 离子启动 TestP
  2. Go to TestP folder转到 TestP 文件夹
  3. Run -> ionic cordova plugin add cordova-plugin-firebase-analytics运行 -> ionic cordova plugin add cordova-plugin-firebase-analytics
  4. Run -> npm install --save @ionic-native/firebase-analytics运行 -> npm install --save @ionic-native/firebase-analytics
  5. Run -> ionic cordova platform add android运行 -> ionic cordova platform add android
  6. Run -> ionic cordova plugin add phonegap-plugin-push运行 -> ionic cordova plugin add phonegap-plugin-push

The error ("Version of installed plugin does not satisfy dependency plugin requirement") asks me to run the statement again using --force but I want to avoid this and intend to understand what is the error and solution for this.错误(“已安装插件的版本不满足依赖插件要求”)要求我使用 --force 再次运行该语句,但我想避免这种情况并打算了解什么是错误和解决方案。

错误

The issue is open on github and discussed here:该问题已在 github 上公开并在此处讨论:

https://github.com/phonegap/phonegap-plugin-push/issues/2722https://github.com/phonegap/phonegap-plugin-push/issues/2722

The main problem is that the last update of this plugin on the NPM repo is 9 months old (as at 27th Feb 2019), so it contains old versions of the dependencies, which prevents it from installing, when there are newer versions of the dependency plugins installed.主要问题是 NPM 存储库上此插件的最后一次更新是 9 个月前(截至 2019 年 2 月 27 日),因此它包含旧版本的依赖项,这会阻止它安装,当有更新版本的依赖项时插件安装。 The only way I can get it to install is to roll back the dependent plugins by several versions eg I'm stuck with having to use firebase-analytics v11 when the latest version is v17.3.我可以安装它的唯一方法是将依赖插件回滚几个版本,例如,当最新版本是 v17.3 时,我不得不使用 firebase-analytics v11。

It is also noted that this was fixed in the github repo, but never published to npm, so you can resolve by using:还要注意的是,这已在 github 存储库中修复,但从未发布到 npm,因此您可以使用以下方法解决:

cordova plugin add https://github.com/phonegap/phonegap-plugin-push.git科尔多瓦插件添加https://github.com/phonegap/phonegap-plugin-push.git

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

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