ionic-team / ionic-team/ionic-cli
'ionic cordova plugin add' command can't install plugin
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 682
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**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:**
Hướng dẫn đóng góp
Hướng nghiên cứu
Reproduce the failure on Windows 10 with `ionic cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git`, then compare it with the same plugin installed using `cordova plugin add`. Start by tracing the Ionic CLI command path and its handling of the reported npm/Git `cannot spawn sh` error; done means GitHub-hosted plugins install successfully through Ionic without breaking the direct Cordova behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 32/100