ionic-team / ionic-team/ionic-cli

'ionic cordova plugin add' command can't install plugin

Abierto
#2,836 6 comentarios 8 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
2k
Forks
682
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Description:**

After call 'ionic cordova plugin add ' I've got error:

> C:\apps\test>ionic cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git
> > cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git --save
> Error: Failed to fetch plugin https://github.com/apache/cordova-plugin-statusbar.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! git clone C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92 C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b: Cloning into 'C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b'...
> npm ERR! git clone C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92 C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b: error: cannot spawn sh: No such file or directory
> npm ERR! git clone C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92 C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b: fatal: unable to fork
> npm ERR! git clone C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92 C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b:
> npm ERR! Windows_NT 10.0.16299
> npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/apache/cordova-plugin-statusbar.git" "--save"
> npm ERR! node v6.5.0
> npm ERR! npm v3.10.3
> npm ERR! code 128
>
> npm ERR! Command failed: git -c core.longpaths=true clone C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92 C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b
> npm ERR! Cloning into 'C:\Users\user\AppData\Local\Temp\npm-17188-2e931d29\git-cache-f713dd3e\c45331b95555c5c77b4ed4ca690236a9b077ec4b'...
> npm ERR! error: cannot spawn sh: No such file or directory
> npm ERR! fatal: unable to fork
> npm ERR!
> npm ERR!
> npm ERR! If you need help, you may report this error at:
> npm ERR!
>
> npm ERR! Please include the following file with any support request:
> npm ERR! C:\apps\test\node_modules\npm-debug.log
>
> [ERROR] An error occurred while running cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git --save
> (exit code 1).

Error returns on install any plugin from GitHub. For example:
```
ionic cordova plugin add https://github.com/appodeal/appodeal-cordova-plugin.git
ionic cordova plugin add https://github.com/appodeal/appodeal-cordova-plugin.git
```

But executing `cordova plugin add ...` without `ionic` works fine

**Steps to Reproduce:**

1. Create new project
2. Try to install plugin with `ionic cordova plugin add ...`

**Output:**

**My `ionic info`:**

> @ionic/cli-utils : 1.15.1
> ionic (Ionic CLI) : 3.15.1
>
> global packages:
>
> cordova (Cordova CLI) : 7.0.1
>
> local packages:
>
> @ionic/app-scripts : 3.0.1
> Cordova Platforms : android 6.2.3
> Ionic Framework : ionic-angular 3.7.1
>
> System:
>
> Android SDK Tools : 26.0.2
> Node : v6.5.0
> npm : 3.10.3
> OS : Windows 10
>
> Environment Variables:
>
> ANDROID_HOME : C:\dev\android-sdk
>
> Misc:
>
> backend : legacy

**Other Information:**

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.