The error RPC failed; curl transfer closed with outstanding read data remaining typically occurs when you have to clone a large repository from a slow internet connection, and the connection tends to close.
Do a shallow clone:
git clone https://github.com/microsoft/TypeScript.git --depth 1
This option allows you to clone only the latest commits, which can be helpful when dealing with large repositories or slow network connections.
Navigate in the local repository directory:
cd TypeScript
Convert a shallow clone of a Git repository into a complete repository with the full commit history:
git fetch --unshallow