A reader balances this post:
It makes sense that we evolved in Africa with dark skin to protect against skin cancer. It also makes sense that when some of our ancestors moved to less sunny places, their descendants evolved lighter skin so we would be able to synthesize sufficient quantities of vitamin D, which our skin makes when it is exposed to the sun. Naturally selecting for lighter skin solved the vitamin D problem, and skin cancer turned out not to be much of an issue far from the equator, and with cloudier skies. It was all about striking a balance between those two competing goals. Lighter-skinned people in sunny places today need sun protection, and darker skinned people in less sunny places today may need vitamin D supplements.