Prep the pan and oven: Heat oven to 350°F (175°C). Grease and line a 9x13-inch pan, or two 8-inch round cake pans with parchment.
Mix dry ingredients: In a medium bowl, whisk flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
Whisk wet ingredients: In a large bowl, whisk eggs, granulated sugar, and brown sugar until smooth.
Whisk in oil, yogurt, and vanilla.
Combine: Add dry ingredients to wet and stir gently until a few flour streaks remain. Fold in grated carrots and any nuts or raisins.
Bake: Spread batter evenly in the pan. Bake 28–35 minutes for a 9x13, or 25–30 minutes for 8-inch rounds, until a toothpick comes out with a few moist crumbs.
Cool completely: Let the cake cool in the pan 15 minutes, then transfer to a rack.
Cool fully before frosting.
Make the frosting: Beat cream cheese and butter until smooth. Add powdered sugar, vanilla, salt, and lemon juice if using. Beat until fluffy and spreadable.
Frost and finish: Spread frosting over the cooled cake.
For layer cakes, frost between layers and all around. Sprinkle with chopped nuts if you like.