Carbon nanotubes have become promising structures for diverse fields such as medicine, engineering, and agriculture due to their advantageous mechanical, thermal, electrical, and chemical characteristics. In the present study, an analytical solution method is proposed for the forced vibration analysis of nanotubes containing flowing fluid and flexibly supported at its ends. The boundary conditions of nanotube are considered as linear translational and rotational springs. Based on the Eringen's nonlocal elasticity theory and Euler-Bernoulli beam model, the governing equations of motion and associated boundary conditions are derived. A Green's function approach is employed to solve governing equations of motion determine dynamic deflection of the system. Then, some numerical instances are presented to examine the effects of nonlocal parameter, frequency of external force, fluid velocity and boundary conditions, spring constants of elastic support on the dynamic deflection of the system. Furthermore, the validity of the suggested model has been verified in comparison with the available results in the literature and good agreement is observed.