Just two countries, Syria and Nicaragua, opposed the 2015 agreement when President Trump announced he would withdraw from it in June 2017.