In the case of fixed expressions such as "avoir envie de", you're literally saying "I have envy of [something]".
Using du, de la, de l' or des would add the definite article (de + le, la, l', les) and would be used to be more specific = I have envy of the [thing] (that I mentionned previously).
J'ai envie de chocolat.
I feel like chocolate.
J'ai envie du chocolat que tu m'avais offert pour mon anniversaire.
I feel like the chocolate you'd given me for my birthday.
I feel like chocolate.
J'ai envie du chocolat que tu m'avais offert pour mon anniversaire.
I feel like the chocolate you'd given me for my birthday.
I hope that's helpful!
À bientôt !