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

3

如何从私有的GitHub repository中安装Cordova插件?

我从一个提供商那里购买了一个私有插件,并且他们允许我的git账户访问他们的私有git仓库。通常我使用cordova cli来安装插件:

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

但是这样会产生以下错误:
    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

我知道URL是正确的,因为GitHub桌面应用程序能够克隆存储库。
软件提供商告诉我这是我和GitHub之间的问题。
以下是需要翻译的问题:
1.我是否可以通过Cordova插件添加命令安装插件?
2.有没有更好的解决方案,我没有想到?
3.我应该只是从GitHub桌面GUI克隆然后将文件复制粘贴到我的项目中吗?
4.这是一个GitHub的问题吗?
5.这是一个Cordova的问题吗?
6.这对私人插件的销售者来说是个问题吗?
感觉我缺少一个关键信息来使它工作。

你好,我遇到了同样的问题。你能否通过 GitHub 链接添加吗? - NewOne
2个回答

6

我发现可以从GitHub桌面克隆的路径安装。我使用了以下命令:

cordova plugin add /path/to/directory

1
我遇到了同样的问题。Cordova在7版本中更改了插件加载方式,因此您应该尝试使用--nofetch选项来使用旧的加载方法。
您的私有插件提供者也可以更新其插件以与新方法配合使用;我发现只需要创建一个package.json文件就可以让我的插件再次工作。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接