I installed Homebrew on my Mac long time ago, then eventually I updated my Mac to OS X El Capitan some time after. I recently need to update npm using Homebrew as I found some instructions on how to update npm via Homebrew.
fatal: git fetch-pack: expected shallow list
Error: Unknown command: upgrade
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
curl: (1) Protocol "https" not supported or disabled in libcurl
curl is just pulling things off the web. Instead of using it you can go to the link you want
and download that in your normal web browser to a file (right click on the link in this answer with firefox, for example). Then you just go in a terminal to the directory where you downloaded it and run
ruby -e uninstall
In fact, if you read the file before you run it, this is more secure too since you actually know what you are going to run.