Oh boy, this is a toughie! I'll give a few suggestions and hope some other moms will bust in with some life-saving ideas too!
I'd do a 2-pronged approach, if it were me. I'd do gradual withdrawal to get you out of the room. I'd also use some psychological/behavioral stuff at the same time. So, you could give him a flashlight to use when he gets scared at night. He's old enough to use one. You could get a 'special' nightlight for him that is an 'anti-shadow' light: no bad shadows will come in ther oom when that light is on, only 'good' shadows (b/c obviously there will still be shadows visible!). You could get a water bottle and every night before bed spray it around to get rid of the 'scary' shadows. You could see if you could find any story books about shadows and how fun or neat they are. You could make shadow puppets together using your hands during the day, in a fun tent/fort you make in the living room. In other words, let's help him feel powerful against the scary thing and also de-scarify it by reading about it or making shadows using your hands. At this age, they'll believe anything you say, so if you tell him his night light chases away 'bad' shadows, he'll believe you! If you tell him that the spray bottle eliminates bad shadows, he'll believe you!
This age is tough because fears are very real and can come from nowhere! All you can do is help him feel powerful and able to confront his fears. You shouldn't deny the fear, though. So, I wouldn't say "There's nothing to be afraid of!" or "don't be afraid of shadows". He *is* afraid, and so give him ways to beat those shadows!