NASA's online history archive says nuclear weapons do things in space. In fact, in one document citing data apparently collected in the 1950's the effects of nuclear weapons detonating in space can be even more deadly, albeit perhaps not as kinetically destructive, as those detonating in an atmosphere. The radiation released by a nuclear weapon detonating in space can damage electrical equipment and kill personnel manning space stations.
|This XKCD comic is not directly relevant to this post but it is amusing.|
If the hypothetical alien invaders are aboard unshielded alien invasion vessels and a nuclear device is detonated nearby they may very well die from radiation exposure - assuming these hypothetical alien invaders are anything like humans. The main problem is, then, how does a mostly gravity well-bound state like any state on Earth effectively fling a nuclear weapon at vile alien would be conquerors?
In the vastness of space even the vast effects of a nuclear weapon are not so indiscriminate as to not require precision aiming. While today's rocket technology can surely be employed to deliver a nuclear warhead almost anywhere near Earth the preparation might take far too long for it to be a practical alien swatting implement.
Can current ICBM's be used to launch our nuclear deterrent at invading alien ships to sufficiently deter them from carrying out nefarious alien plans with radiation? The answer appears to be no - at least not without significant re-engineering. At this point the U.S.' defense policy makers should really be compelled to ask themselves; "Why can't the U.S.A., the natural defender and champion of mankind, launch nuclear weapons at hypothetical alien invaders' ships reliably and on short notice?" If the U.S. military is capable of striking at aliens outside of low earth orbit with nuclear weaponry then why hasn't the public been made aware of this? To prevent mass panic in the eventuality of an alien incursion it is vital to know that Earth is well defended by a sturdy roentgen barrier.