High-harmonic generation (HHG), which is generation of multiple optical harmonic light, is an unconventional nonlinear optical phenomenon beyond perturbation regime. HHG, which was initially observed in gaseous media, has recently been demonstrated in solid state materials. How to control the extreme nonlinear optical phenomena is a challenging subject. Compared to atomic gases, solid state materials have advantages in controlling electronic structures and carrier injection. Here, we demonstrate control of HHG by tuning electronic structure and carrier injection using single-walled carbon nanotubes (SWCNTs). We reveal systematic changes in the high-harmonic spectra of SWCNTs with a series of electronic structures from a metal to a semiconductor. We demonstrate enhancement or reduction of harmonic generation by more than one order of magnitude by tuning electron and hole injection into the semiconductor SWCNTs through electrolyte gating. These results open a way to control HHG within the concept of field effect transistor devices.