Here is an explanation of how to know when to use ‘avoir besoin de’ or ‘avoir envie de’ or ‘devoir’. I figured out, after several hours and then using the link below, that to use ‘avoir envie de’ to mean ‘to have need of’ you must use it in this construction (from the lesson below):
To express to ... need [to do something], you will use avoir envie de / d' + infinitive of the verb.
Without the infinitive of a verb, avoir envie de cannot mean the same as ‘to need’. It will simply mean the same as ‘I want’. Note that ‘devoir + infinitive also means ‘to need’.
So, when trying to work out which one is correct to mean ‘to you have need of’ in the four answer options, if ‘devoir’ and/or ‘avoir envie de’ have an infinitive following them, they can also be marked as correct as ‘avoir besoin de’.
https://french.kwiziq.com/my-languages/french/tests/results/5955063/system?quick-lesson-popup=7