5. Given the imaginary number $z$ satisfies $z^{3}+1=0, z \neq-1$. Then $\left(\frac{z}{z-1}\right)^{2018}+\left(\frac{1}{z-1}\right)^{2018}=$ $\qquad$ .
5. -1 .
$$
\begin{array}{l}
\text { Given } z^{3}+1=0 \\
\Rightarrow(z+1)\left(z^{2}-z+1\right)=0 \\
\Rightarrow z^{2}-z+1=0 . \\
\text { Then }\left(\frac{z}{z-1}\right)^{2018}+\left(\frac{1}{z-1}\right)^{2018} \\
=\frac{z^{2018}+1}{\left(z^{2}\right)^{2018}}=\frac{z^{2}+1}{z^{4}}=\frac{z^{2}+1}{-z}=-1 .
\end{array}
$$