Begin by getting your oven hot set it to 350°F (175°C). While it warms up, prepare your cake pans by greasing them thoroughly. You can either dust them with flour or line them with parchment paper to keep the cake from sticking.
In a separate bowl, mix together your dry ingredients: flour, baking powder, baking soda, cinnamon, nutmeg, ginger, and salt. Stir them well so the spices and leavening agents are evenly spread through the flour.
Now, grab a large mixing bowl and beat the eggs with the granulated sugar, brown sugar, oil, and vanilla extract. Continue mixing until the texture becomes smooth and slightly thick—everything should be well blended at this point.
Once that’s done, stir in the grated carrots, making sure they’re fully incorporated. Then add the drained pineapple and, if you like, a handful of chopped nuts for a bit of crunch and texture. Mix until everything is evenly combined.
Next, bring the dry ingredients into the mix. Add them gradually to the wet mixture, stirring gently. Be careful not to over mix stop as soon as the flour disappears into the batter. Overworking the batter will make the cake heavy.
Pour the finished batter into your prepared pan, smoothing the surface with a spatula. Slide it into the oven and bake for about 40 to 45 minutes. You’ll know it’s done when a toothpick inserted in the center comes out clean or with just a few moist crumbs.
After baking, take the cake out and let it cool in the pan for about 10 minutes. Then, carefully remove it and place it on a wire rack to cool completely. This step is key doesn’t frost the cake until it’s no longer warm.
To make the frosting, beat together softened cream cheese and butter until smooth. Gradually add powdered sugar, mixing until there are no lumps. Stir in vanilla and a bit of lemon juice to brighten the flavor. Continue beating until the frosting is fluffy and easy to spread.
When the cake has cooled, spread the frosting generously across the top. If you’ve baked a layer cake, frost between the layers too. For a finishing touch, sprinkle some chopped nuts on top if you’d like. Then slice it up and serve.