3

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

ghybs
  • 47,565
  • 6
  • 74
  • 99
Ruben
  • 816
  • 1
  • 8
  • 21

1 Answers1

3

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

Ruben
  • 816
  • 1
  • 8
  • 21
ghybs
  • 47,565
  • 6
  • 74
  • 99
  • Thank you for a functional and well explained answer @ghybs, it is working now! The way to find the commit hash is going to the URL of the github package and then look into releases > commit ID (Something like this: -o- c0f8da9) > and in the upper right corner you will find the commit SHA hash. Just as an exercise I tried to generate the SHA hash by myself using some keys like the commit ID but I can't find the right key to got it. – Ruben Aug 16 '16 at 17:40