Installing Cordova plugin to meteor project using a github tarball link

送分小仙女□ 提交于 2021-01-27 16:44:20

问题


I'm trying to install a package to my meteor project using a repository in github.
The only way Meteor allow me to install it is using a "tarball" specific link like this: https://github.com/Wizcorp/phonegap-facebook-plugin/tarball/d8b0f6935a7c6e586188bf85f9da88a1c160790b

Although, the package version referenced in the link is not the one I need (I got that link from an old support post).

Could someone explain me how to obtain that type of link (tarball) from this repository and version (0.12.0)? https://github.com/Wizcorp/phonegap-facebook-plugin/releases/tag/v0.12.0

So far I have tried:

  1. Copy the tar.gz download link of the right version and running: meteor add cordova:com.phonegap.plugins.facebookconnect@https://github.com/aogilvie/phonegap-facebook-plugin/archive/0.6.0.tar.gz

    Result: "Meteor requires either an exact version, a Git URL with a SHA reference"

  2. Installing it using the version number: meteor add cordova:com.phonegap.plugins.facebookconnect@0.12.0

    Result: I got "Package installed" but when run ios-device I got the error: "Failed to fetch plugin com.phonegap.plugins.facebookconnect@0.12.0 via registry".

  3. Downloading the zip file, unzip and put folder in packages folder.

    Result: Is not working because is not a package.js inside the folder.

Thanks in advance


回答1:


You are actually trying to add a Cordova plugin (meteor add cordova:...), not a Meteor package.

Therefore, your trial 3 (local package / plugin) needs a similar meteor add cordova:your-plugin-name@file://packages/folder-to-local-cordova-plugin instead of a meteor add package-name (which will look for a package.js file).

Trial 2 (version number) works only for published plugins.

You should stick with your trial 1 but you have to specify the commit hash (git endpoint + # + commit hash) instead of the tarball link:

meteor add cordova:com.phonegap.plugins.facebookconnect@https://github.com/Wizcorp/phonegap-facebook-plugin.git#c0f8da97a1d65397ada73e958dafed3aeef2e491

See Meteor Guide > Build > Mobile > Native features with Cordova plugins > Installing plugins > Installing a plugin from Git



来源:https://stackoverflow.com/questions/38964795/installing-cordova-plugin-to-meteor-project-using-a-github-tarball-link

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!