Preheat the oven to 350°F (175°C). Grease and flour two 8-inch round cake pans, or grease and line the bottoms with parchment paper. Alternatively, prepare a 9×13-inch pan if making a sheet cake.
In a large bowl, whisk together the flour, granulated sugar, brown sugar, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger until well combined and any brown sugar clumps are broken up.
2 cups all-purpose flour, 1 1/2 cups granulated sugar, 1/2 cup light brown sugar, 2 teaspoons baking powder, 1 teaspoon baking soda, 1 teaspoon fine sea salt, 2 teaspoons ground cinnamon, 1/2 teaspoon ground nutmeg, 1/2 teaspoon ground ginger
In a separate medium bowl, whisk together the oil, eggs, vanilla, and milk until smooth and slightly thickened.
1 cup neutral oil, 4 large eggs, 2 teaspoons vanilla extract, 1/4 cup milk
Pour the wet mixture into the bowl with the dry ingredients. Gently whisk or stir with a spatula just until no large streaks of flour remain; do not overmix.
Fold in the grated carrots until evenly distributed. If using, gently fold in the chopped walnuts or pecans and raisins. If the raisins are very dry, soak them briefly in warm water, then pat dry before adding.
3 cups grated carrots, 1/2 cup chopped walnuts or pecans, 1/2 cup raisins
Divide the batter evenly between the prepared 8-inch pans and smooth the tops. Bake for 28–35 minutes for round layers, or 35–40 minutes in a 9×13-inch pan, until a toothpick inserted in the center comes out mostly clean with a few moist crumbs.
Let the cakes cool in the pans for 10–15 minutes. Run a knife around the edges, then carefully turn them out onto a wire rack. Cool completely before frosting so the cream cheese frosting does not melt.
In a large bowl or stand mixer fitted with the paddle attachment, beat the softened cream cheese and butter together until very smooth and creamy, about 2–3 minutes. Add the vanilla and a pinch of salt. Gradually add 4 cups of sifted powdered sugar, mixing on low at first, then increasing the speed until light and fluffy. Add heavy cream or milk 1 teaspoon at a time until you reach your desired consistency. For a thicker, pipeable frosting, add up to 1 additional cup of powdered sugar.
16 oz cream cheese, 1/2 cup unsalted butter, 4 cups powdered sugar, 2 teaspoons vanilla extract, 1 pinch salt, 1 tablespoon heavy cream or milk
If needed, level the tops of the cooled cake layers with a long serrated knife. Place one layer on a serving plate and spread a generous layer of cream cheese frosting over the top. Place the second layer on top and frost the top and sides of the cake. Decorate with chopped walnuts, a light sprinkle of cinnamon, or carrot curls if desired.
chopped walnuts, ground cinnamon