问题
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:
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"
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".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