As the world reels from spikes in oil and gas prices, the fallout from Russia’s invasion of Ukraine has laid bare a dilemma: Nations remain extraordinarily dependent on fossil fuels and are struggling to shore up supplies precisely at a moment when scientists say the world must slash its use of oil, gas and coal to avert irrevocable damage to the planet.

While countries could greatly reduce their vulnerability to wild swings in the oil and gas markets by shifting to cleaner sources of energy such as wind or solar power and electric vehicles — which is also the playbook for fighting climate change — that transition will take years.

So, for now, many governments are more urgently focused on alleviating near-term energy shocks, aiming to boost global oil production to replace the millions of barrels per day that Russia has historically exported but which is now being shunned by Western nations.