简体   繁体   中英

Cordova plugin from private GitHub repository

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.

I found I could install from the path where the GitHub desktop cloned. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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