Troubled electric vehicle maker Nikola has filed for Chapter 11 bankruptcy protection months after saying that it would likely run out of cash early this year.