Preheat the oven to 350°F (175°C) and grease a cake pan, lining the bottom with parchment paper.
In a large bowl, whisk together the flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
In another bowl, whisk the eggs, granulated sugar, brown sugar, vegetable oil, and vanilla until smooth and glossy.
Pour the wet ingredients into the dry ingredients and gently fold until just combined.
Fold in the grated carrots and optional chopped nuts.
Pour the batter into the prepared pan and smooth the top evenly.
Bake for 30–40 minutes, until a toothpick inserted in the center comes out clean or with moist crumbs.
Let the cake cool completely before frosting, if using.