Well, not really. Currently there are two ways to stop a country from developing nuclear weapons: prevent it from obtaining the necessary uranium, or prevent it from obtaining the equipment it needs to process that uranium. Together these measures are highly effective at preventing the vast majority of countries from obtaining the stockpiles of enriched uranium they need to build a crude but effective gun type warhead.
The exception is when you have a country like Iran that (a) can dig uranium out of its own soil and (b) has the industrial, scientific and engineering capability to build its own refining equipment. There aren't many countries like that, but if one of them wants a bomb there's only two ways left to stop them: (1) invade them, or (2) convince them they'd be better off without a bomb. And thus far we haven't invaded countries because they're developing nuclear weapons. We didn't do it in India, we didn't do it in Pakistan, and we aren't even doing it in North Korea. Sure, we invaded Iraq, but nukes were just a pretext; the evidence we used to justify the attacks was known to be false at the time.