Carbon nanotubes (CNTs) are pivotal components in nanoelectromechanical applications. Investgaing the dynamics of CNTs helps in expanding our understanding of their mechanical properties in nanoengineering endeavors. This study delves into the chaotic characteristic of single-walled carbon nanotube (SWCNT) systems involving phase-shifting external excitation and cubic nonlinear damping. Employing compactification theory, we investigate the system's dynamics at infinity, unveiling its global structure. Analytic solutions for homoclinic/heteroclinic orbits are derived, and utilizing the Melnikov method, we establish criteria for chaos onset in this periodically excited, perturbed SWCNT system. Through bifurcation diagrams, Lyapunov exponent spectra, Poincaré sections, and homoclinic bifurcation surfaces, we empirically confirm the occurrence of chaos, substantiating our theoretical analyses with simulation results.