Cordova plugin from private GitHub repository

故事扮演 提交于 2019-12-10 10:53:17

问题


What is the preferred way to install a Cordova plugin from a private GitHub repository?

I have purchased a private plugin from a provider who granted my git account access to their private git repository. Normally I install plugins from the cordova cli with:

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.

The software provider who sold me the plugin told me this was a problem between me and GitHub.

  1. Should I be able to install the plugin from the Cordova plugin add command?
  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?
  4. Is this a GitHub problem?
  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.


回答1:


I found I could install from the path where the GitHub desktop cloned. I used the following command:

cordova plugin add /path/to/directory



回答2:


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.

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.



来源:https://stackoverflow.com/questions/36313178/cordova-plugin-from-private-github-repository

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