Adding git based platform does give unhelpful error on system with no git installed
- Dominant language
- JavaScript
- Stars
- 967
- Forks
- 344
- Avg merge
- 8h 41m
- Merged PRs (30d)
- 9
Description
# Bug Report
## Problem
### What is expected to happen?
User should be told that they are missing git and should install it.
### What does actually happen?
```
C:\Users\User\Documents\cordovaWindows>cordova platform add https://github.com/apache/cordova-windows
Using cordova-fetch for https://github.com/apache/cordova-windows
Failed to fetch platform https://github.com/apache/cordova-windows
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/apache/cordova-windows.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-05-04T19_00_14_466Z-debug.log
```
## Information
Add a platform via its git URL (e.g. GitHub) on a system that has no git installed.
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Contributor guide
Research direction
Start with the `cordova platform add ` entry point and reproduce the failure on a system without git installed. Trace the npm git-fetch error and make the user-facing result identify the missing git dependency and installation need; done means this case no longer reports only a generic connection or platform-specification error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100