简体   繁体   English

来自私有GitHub存储库的Cordova插件

[英]Cordova plugin from private GitHub repository

What is the preferred way to install a Cordova plugin from a private GitHub repository? 从私有GitHub存储库安装Cordova插件的首选方法是什么?

I have purchased a private plugin from a provider who granted my git account access to their private git repository. 我已从提供者那里购买了一个私有插件,该提供者授予了我的git帐户对其私有git存储库的访问权限。 Normally I install plugins from the cordova cli with: 通常,我使用以下命令从cordova cli安装插件:

cordova plugin add https://github.com/somePrivateRepo/purchasedPlugin.git

But this yielded the following error: 但这产生了以下错误:

    Error: Failed to fetch plugin https://github.com/somePrivateRepo/purchasedPlugin.git via git.
    Either there is a connection problems, or plugin spec is incorrect:
    Error: C:\Program Files\Git\cmd\git.exe: Command failed with exit code 1
    28 Error output:
    Cloning into 'C:\Users\xxxx\AppData\Local\Temp\git\1459346362064'...
    bash: /dev/tty: No such device or address
    error: failed to execute prompt script (exit code 1)
    fatal: could not read Username for 'https://github.com': Invalid argument

I know the URL is good as the GitHub desktop was able to clone the repository. 我知道URL很好,因为GitHub桌面能够克隆存储库。

The software provider who sold me the plugin told me this was a problem between me and GitHub. 向我出售该插件的软件提供商告诉我,这是我和GitHub之间的问题。

  1. Should I be able to install the plugin from the Cordova plugin add command? 我应该能够从Cordova plugin add命令安装插件吗?
  2. Is there a better solution that I have not thought of? 有没有我没有想到的更好的解决方案?
  3. Should I just clone from the GitHub desktop GUI then copy and paste the files into my project? 我是否应该从GitHub桌面GUI克隆,然后将文件复制并粘贴到我的项目中?
  4. Is this a GitHub problem? 这是GitHub问题吗?
  5. Is this a Cordova problem? 这是科尔多瓦的问题吗?
  6. Is this a problem for the seller of the private plugin? 这对于私有插件的卖家来说是个问题吗?

Feels like I am missing a key piece of information to make this work. 感觉我正在丢失一项重要的信息来完成这项工作。

I found I could install from the path where the GitHub desktop cloned. 我发现可以从GitHub桌面克隆的路径安装。 I used the following command: 我使用以下命令:

cordova plugin add /path/to/directory

I had the same issue. 我遇到过同样的问题。 Cordova changed its plugin loading at Cordova 7, so you should try using the --nofetch option to use the old loading method. Cordova在Cordova 7更改了其插件加载,因此您应该尝试使用--nofetch选项来使用旧的加载方法。

Your private plugin provider could also update his plugin to work with the new method; 您的私人插件提供商也可以更新其插件以使用新方法。 I found it just needed a package.json file creating to get mine working again. 我发现它只需要创建一个package.json文件即可使我的文件再次工作。

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

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