In brief: It wasn't that France was working on a nuclear weapon for 8 (or more) years before achieving one. Rather, it spent until 1957 building up a nuclear infrastructure focused mainly around nuclear reactors. In 1957/1958 it decided that it should develop nuclear weapons, and was able to detonate its first weapon in 1960. Which is to say, you can think of it has having two distinct phases, one of which wasn't about making nuclear weapons (but kept the option explicitly open), and the other which was.
The decision about whether to build nuclear weapons has historically been a very big one for states to take. The US and Soviets developed their nuclear industries explicitly around the idea of getting weapons first and as soon as possible. The British took a slower approach, picking and choosing their technologies in order to essentially make a more "budget" weapon. The French instead decided to become world-leaders in nuclear reactors, and only after doing very well at that pivoted to weapons.
The time it took the French wasn't about disparities in technological prowess. It was about differences in national priorities. The French government began to believe, in the late 1950s, that it would not be respected as an independent "great power" of the world without nuclear weapons, no matter its other qualities. It was not so much an urgent security need (as with the US and USSR).