In this paper, the nonlocal Euler–Bernoulli beam theory is presented to study the primary resonance and chaotic vibration of a curved single-walled carbon nanotube (CSWCNT). The CSWCNT is exposed to axial thermomagnetic and transverse harmonic forces resting on a viscoelastic foundation. A single-mode Galerkin approximation is implemented to transform the nonlinear governing partial differential equation into an ordinary one. The multiple scales method is employed to determine the primary resonance response of a clamped–clamped CSWCNT under harmonic external force. The effects of magnetic field strength, temperature change and amplitude of sinusoidal curvature, mode number and different boundary conditions including clamped–free and free–free are examined to study the jumping phenomenon and instability states in primary resonance frequency response. Moreover, by applying the Runge–Kutta numerical method, the bifurcation diagram and the largest Lyapunov exponent curve are generated to detect the chaotic values of external amplitude of excitation. The phase plane trajectories along with Poincare map are presented to show the chaotic and periodic vibration of a CSWCNT. The results show that the axial thermomagnetic forces have significant effects on the frequency response of a CSWCNT and the nonlinear chaotic vibration has a strong dependency on the amplitude of excitation.