We propose a novel mathematical framework to examine the free damped transverse vibration of a nanobeam by using the nonlocal theory of Eringen and fractional derivative viscoelasticity. The motion equation of a nanobeam with arbitrary attached nanoparticle is derived by considering the nonlocal viscoelastic constitutive equation involving fractional order derivatives and using the Euler--Bernoulli beam theory. The solution is proposed by using the method of separation of variables. Eigenvalues and mode shapes are determined for three typical boundary conditions. The fractional order differential equation in terms of a time function is solved by using the Laplace transform method. Time dependent behavior is examined by observing the time function for different values of fractional order parameter and different ratios of other parameters in the model. Validation study is performed by comparing the obtained results for a special case of our model with corresponding molecular dynamics simulation results found in the literature.