npm install shows error with git not found

In my case, I had Git installed, but it was only accessible from Git Bash (I had selected the first option below when installing). I reinstalled with the second option and it solved the issue:

enter image description here


You need to install git in your machine to have it working.

undefined ls-remote -h -t ssh://[email protected]/eligrey/FileSaver.js.git

it should have been

git ls-remote -h -t ssh://[email protected]/eligrey/FileSaver.js.git

There is error related to git path. check this ls-remote command