Preheat your oven to 350°F (175°C) and grease a 9x13-inch baking dish.
In a large bowl, whisk together the flour, baking soda, salt, cinnamon, and nutmeg.
In another bowl, combine the sugars, oil, eggs, and vanilla extract. Whisk until smooth.
Stir the wet ingredients into the dry mixture until just combined—don’t overmix.
Fold in the grated carrots and pecans (if using).
Pour the batter into the prepared pan and smooth the top.
Bake for 35-40 minutes, or until a toothpick inserted in the center comes out clean.
Let the cake cool completely before frosting it with your favorite cream cheese frosting.