ionic-team / ionic-team/ionic-cli

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

未关闭
#2,836 6 条评论 8 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
2k
派生
682
PR 合并指标
30 天内没有已合并 PR

描述

**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:**

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。