Cordova plugins from Github bug?


#1

Hi,

I’ve been testing quite a few cordova plugins within my apps and keep finding that I get an error similar to this

✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --variable... (exit code 1):

        Error: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins/Mapbox via registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.

After running the command to install a cordova plugin from github using this command “ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --variable ACCESS_TOKEN=” I get the error. It isn’t this specific plugin as it happens with the keyboard plugin and others I’ve attempted to install with a github repo.

Anyone know what the problem is because it seems like only the stable version can ever be installed via npm?


#2

This is the exact command you are running?

What CLI are you running? Post your ionic info output.


#3

Yeah, the same code but with the token key after the =

global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v6.10.0
    OS         : Windows 7
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

#4

Is this similar to your error output?

PS C:\Users\Jan\Documents\superTest> ionic cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --varia
ble ACCESS_TOKEN=123
> cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --variable=ACCESS_TOKEN=123 --save
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --variable
... (exit code 1):

        Error: Failed to fetch plugin https://github.com/Telerik-Verified-Plugins/Mapbox via registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.
        Error: cmd: Command failed with exit code 1 Error output:
        npm ERR! git clone --template=C:\Users\Jan\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://gi
thub.com/Telerik-Verified-Plugins/Mapbox.git C:\Users\Jan\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-Te
lerik-Verified-Plugins-Mapbox-git-cdd067c9: Cloning into bare repository 'C:\Users\Jan\AppData\Roaming\npm-cache\_git-re
motes\git-https-github-com-Telerik-Verified-Plugins-Mapbox-git-cdd067c9'...
        npm ERR! git clone --template=C:\Users\Jan\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://gi
thub.com/Telerik-Verified-Plugins/Mapbox.git C:\Users\Jan\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-Te
lerik-Verified-Plugins-Mapbox-git-cdd067c9: fatal: Unable to find remote helper for 'https'
        npm ERR! Windows_NT 10.0.15063
        npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.
js" "install" "https://github.com/Telerik-Verified-Plugins/Mapbox" "--save"
        npm ERR! node v6.10.3
        npm ERR! npm  v3.10.10
        npm ERR! code 128

        npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\Jan\AppData\Roaming\npm-cache\_git
-remotes\_templates --mirror https://github.com/Telerik-Verified-Plugins/Mapbox.git C:\Users\Jan\AppData\Roaming\npm-cac
he\_git-remotes\git-https-github-com-Telerik-Verified-Plugins-Mapbox-git-cdd067c9
        npm ERR! Cloning into bare repository 'C:\Users\Jan\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-
Telerik-Verified-Plugins-Mapbox-git-cdd067c9'...
        npm ERR! fatal: Unable to find remote helper for 'https'
        npm ERR!
        npm ERR!
        npm ERR! If you need help, you may report this error at:
        npm ERR!     <https://github.com/npm/npm/issues>

        npm ERR! Please include the following file with any support request:
        npm ERR!     C:\Users\Jan\Documents\superTest\node_modules\npm-debug.log


#5

Running cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --variable=ACCESS_TOKEN=123 --save directly, without ionic in front, seems to work for me. Strange.

Can you confirm?

My ionic info:

global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

#6

Yeah that worked haha. But now when I try to use the plugin typescript cannot find ‘Mapbox’. Can you help?


#7

Open a new topic for that please.


#8

I created an issue with ionic-cli for this:


#9

same problem

Error: Failed to fetch plugin https://github.com/Riyaz0001/ionic-plugin-ExternalSdCardPath.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! code 128
npm ERR! Command failed: C:\Program Files\Git\cmd\git.EXE submodule update -q --init --recursive
npm ERR! fatal: 'submodule' appears to be a git command, but we were not
npm ERR! able to execute it. Maybe git-submodule is broken?
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\riyaz\AppData\Roaming\npm-cache\_logs\2017-12-09T20_33_15_433Z-debug.log

[ERROR] An error occurred while running cordova plugin add
        https://github.com/Riyaz0001/ionic-plugin-ExternalSdCardPath.... (exit code 1).

Ionic Info:
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0

System:

Node : v9.2.1
npm  : 5.6.0
OS   : Windows 10