cordova-cli icon indicating copy to clipboard operation
cordova-cli copied to clipboard

Adding git based platform does give unhelpful error on system with no git installed

Open janpio opened this issue 6 years ago • 3 comments

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

janpio avatar May 04 '19 19:05 janpio

For me this is an upstream issue in npm. We just call npm with any specs we want to install. We don't even check if it is a git spec. And I would not want to change that

raphinesse avatar May 04 '19 19:05 raphinesse

I tend to agree with @raphinesse here.

While cryptic... NPM does say git doesn't exists:

npm ERR! path git
npm ERR! code ENOENT

Where ENOENT stands for "Error No Entity", ie git doesn't exists.

breautek avatar Sep 24 '20 14:09 breautek

I suggest to close this issue as won't fix then

raphinesse avatar Sep 24 '20 17:09 raphinesse