Radio solution

If you have a problem with a neighbour’s dog, ask the dog’s owner to place a transistor radio near the dog’s bed and turn it on to a 24-hour radio station, just loud enough for the dog to hear.

Then leave the radio on 24 hours a day whether there is someone home or not.

Very soon, the dog gets used to the radio sound and will not get nervous or lonely and hence not bark.

This works.