You don’t need to blow up the whole asteroid. All it needs is just enough explosive force to “nudge” the asteroid to a new orbit to miss the Earth.
Okay, forgive me, just a midwesterner here, but wouldn’t the nuke need a medium, like air, to create the necessary sock wave to ‘nudge’ the beast?