In this paper, we consider the problem about finding out perfect powers in an alternating sum of consecutive cubes. More precisely, we completely solve the Diophantine equation (x+1)3−(x+2)3+⋯−(x+2d)3+(x+2d+1)3=zp, where p is prime and x,d,z are integers with 1≤d≤50.